in reply to Re: Scanning a plsql package body to make package headers... regexp requested
in thread Scanning a plsql package body to make package headers... regexp requested
Actually m made no difference in output. And
what I had was working, it's just that the word "function"
was in a comment and my regexp was lapping it up, so I will
simply filter comments from the text before parsing it:
Prince "I knew I was the regexp overlord" Pawn#!/arudev/bin/perl use strict; my $file = shift or die "must supply body file"; open F, $file; my @text = <F>; my $text = join '', grep { ! /\s+\-{2,}/ } @text; my $regex = '(procedure|function)\b(.*?)\((.*?)\)'; while ($text =~ /$regex/gs) { print "*$1+$2-$3*",$/; }
|
---|
In Section
Seekers of Perl Wisdom