Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://278833]
help
Chatterbox?
[Eily]: it doesn't work in French AFAIK
[Eily]: I like the first one though :)
[erix]: balloonist, surely :P (or maybe baloneyist)
[marto]: afternoon all
[Corion]: Hi marto ;)
[Corion]: Eily: Yeah - my French isn't even good to understand jokes, much less to make them :-D
[Corion]: marto: That post is a repost/duplicate of Excel sheet data write issue :-D

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2017-09-21 14:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (248 votes). Check out past polls.

    Notices?