There is a file with VBA functions and procedures. It is necessary to pull out their first lines using a regular expression.
my $s = 'Public Function SheetReMake(ByVal sheetName As String) As Worksheet \' создает новую таблицу, если такая есть, то ее удаляет'; my @arr = ($s =~ m/^((public|private)*\s*(function|sub)+\s+(\w+)\(.*?\)(.*?))+$/igm); print $#arr."\n"; for my $i(0..$#arr) { print $arr[$i]."\n"; } Instead, “Public”, “Private”, “Sub”, “Function”, etc., as well as the entire required strings, fall into the @arr array separately. What am I doing wrong?
?:Ru.wikipedia.org/wiki/… - Visman?:all that does - it makes these brackets not captured - Mike