Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Remove text within parenthesis

by choroba (Canon)
on May 07, 2013 at 22:11 UTC ( #1032536=note: print w/ replies, xml ) Need Help??


in reply to Remove text within parenthesis

To avoid the interpretation of parentheses inside $1, use \Q:

$s =~ s/\Q$1//;

Note that this is still not the desired "bla bla somestring" because there are two spaces after the bla bla.

لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Remove text within parenthesis
Select or Download Code
Replies are listed 'Best First'.
Re^2: Remove text within parenthesis
by firmament (Novice) on May 08, 2013 at 07:32 UTC
    Thanks a lot for the \Q advice, very interesting.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2015-07-31 05:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls