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

Re: better way to escape escapes (1 pass)

by tye (Sage)
on Apr 16, 2014 at 01:42 UTC ( #1082414=note: print w/replies, xml ) Need Help??


in reply to better way to escape escapes

Often better to do such things in a single pass.

s{[\\@]([\\@]|[_A-Za-z]+)}{ my $term = $1; if( $term =~ /[\\@]/ ) { $term # Replace repeated escapes with second of pair } else { print "Extracted code '$term'\n"; '' # Replace extracted codes with nothing. } }ge;

- tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1082414]
help
Chatterbox?
[Lady_Aleena]: IMO, Fancy::Join:: Grammatical isn't bad, but RolePlaying:: WorldBuilding:: WorldBuildersGuide book::ClimateTerra inSubsistance is on the long side.
[Lady_Aleena]: I'm still in reorganizing/ renaming mode.

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2017-05-24 22:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?