Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: contextual substitution with s///?

by choroba (Canon)
on Feb 01, 2013 at 16:13 UTC ( #1016575=note: print w/ replies, xml ) Need Help??

in reply to contextual substitution with s///?

Capture what should remain, not what should change:

$s = "test string x x\nFeb 1 09:12:33 ("; $s =~ s/^(\w{3}) /$1 /m;
Also note that if you are matching multiline string, the /m modifier is needed to match after a newline.
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Comment on Re: contextual substitution with s///?
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2015-11-26 04:55 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (696 votes), past polls