Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Parsing with regular expressions

by chunlou (Curate)
on Jul 29, 2003 at 14:11 UTC ( #278833=note: print w/ replies, xml ) Need Help??


in reply to Parsing with regular expressions

Not sure it will always work the way you want but you could try to use (?{CODE}) in your regex.

$_ = "glad guy sad gal\n" ; while( / (?{print "$`\n"}) (\b.a.\b|..l) (?{print "\nmatch: $&\n\n"}) /gx ){}; __END__ g gl gla glad glad glad g glad gu glad guy glad guy match: sad glad guy sad glad guy sad match: gal


Comment on Re: Parsing with regular expressions
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2014-12-29 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls