Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Re: Re: Replacement Regex

by I0 (Priest)
on Mar 22, 2002 at 00:34 UTC ( #153467=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Replacement Regex
in thread Replacement Regex

$_ = '(($a $a hi) $a ($a) $a) $a ($a) $a '; my $re; ($re=$_) =~ s/((\()|(\))|.)/${['(','']}[!$2]\Q$1\E${[')','']}[!$3]/gs; $re = join'|',map{quotemeta}eval{/$re/}; die $@ if $@ =~ /unmatched/; s/($re)|\$a/$1?$1:'$b'/eg;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2016-09-27 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (500 votes). Check out past polls.