Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: substitute characters in the RHS of a search & replace

by kcott (Archbishop)
on Mar 08, 2013 at 21:56 UTC ( [id://1022502]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    s{\[\[(.*?)\]\]}{$1 =~ s/ /_/gr}e
    
  2. or download this
    $ perl -Mstrict -Mwarnings -E '
    my $x = q{Here are [[a variable number of words]] in brackets};
    ...
    Here are a_variable_number_of_words in brackets
    Here are [[a variab]le number [ of ] wo[rds]] in brackets
    Here are a_variab]le_number_[_of_]_wo[rds in brackets
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-18 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found