Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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?
[Corion]: marto:I hope you're well
[marto]: Corion crazy busy at the moment, with work (and a tpue), the kids and some external factors
[marto]: hopefully everything is good with you

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2017-02-24 09:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (353 votes). Check out past polls.