Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2016-02-10 02:15 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (331 votes), past polls