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

Re^2: Match a pattern only if it is not within another pattern

by punkish (Priest)
on Aug 16, 2005 at 19:53 UTC ( [id://484229]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $str =~ s/((?<!bar)\S*)foo(\S*(?!qux))/${1}123${2}/gx;
    
    print "$str\n";
    
  2. or download this
    bl123 and barthis123thatqux and barso123quxhim and123som 123
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2024-04-23 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found