Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Scanning a plsql package body to make package headers... regexp requested

by princepawn (Parson)
on Mar 28, 2001 at 03:26 UTC ( #67677=note: print w/replies, xml ) Need Help??


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:
#!/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*",$/; }
Prince "I knew I was the regexp overlord" Pawn

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://67677]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2021-05-17 18:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (159 votes). Check out past polls.

    Notices?