Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: better way to escape escapes (updated)

by LanX (Canon)
on Apr 16, 2014 at 01:09 UTC ( #1082413=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      DB<120> $str='xxx@@xx\@xx@abc\@xxx@efg@\xxx'
     => "xxx\@\@xx\\\@xx\@abc\\\@xxx\@efg\@\\xxx"
    ...
    
      DB<122> grep { defined } $str =~ m/ (?: [\\\@]{2} | ( \@\w+ ) | . ) 
    +/xg
      => ("\@abc", "\@efg")
    
  2. or download this
      DB<135> grep {defined} $str =~ m/ (?: [\\\@]{2}+ | ( [\\\@]\w+ ) | [
    +^\\\@]+ ) /xg 
     => ("\@abc", "\@efg")
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2014-10-21 22:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (111 votes), past polls