Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-03-25 11:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (311 votes). Check out past polls.