Murali wrote:
Hi,

Hello,

I have a scalar variable $x whose value is "a(b"

I am trying to replace the paranthesis with a backslash followed by
parenthesis, I mean, ( to \(

$x =~ s/\(/\\(/g;

However this is making $x as "a\\(b" which is not what I want.

Can somebody please help me with the regular expression here?

$x =~ s/(?<!\\)\(/\\(/g;



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall
Thu Jan  3 09:48:48 UTC 2008

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to