Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: This regexp made simpler

by rubasov (Friar)
on Apr 25, 2010 at 12:48 UTC ( #836779=note: print w/ replies, xml ) Need Help??


in reply to This regexp made simpler

More variations on the theme (if I got it right - the Z is repeated though). The second one does not use captures at all.

while (<DATA>) { print; #s/^A(|\s[^Z]*)Z$/A$1IZ/; s/^A(?:|\s[^Z]*)\K(?=Z$)/I/; print; } __DATA__ AZ AZZ A SOMETHING Z ASOMETHINGZ A Z A ZZ AAZZ AA ZZ


Comment on Re: This regexp made simpler
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2014-10-01 23:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (41 votes), past polls