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

Re: Look behind and global

by maa (Pilgrim)
on Mar 14, 2005 at 11:51 UTC ( [id://439234]=note: print w/replies, xml ) Need Help??


in reply to Look behind and global

Hi gingaloon

if you have 12345 then the sequences of two digits are 12 23 34 45...

HTH - Mark

Update: my (guessed) explanation as to why you don't get what you want is that you're not modifying the pattern "in-place", so to speak, so the regexp engine doesn't take account of the changes it makes. This is one use for backreferences (\1 \2 \3)

Update 2: why not just s/(\d\d)/$1\n/g?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 15:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found