How to make "a(b" as "a\(b"?

2008-01-03 Thread Murali
Hi, 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?

Re: How to make "a(b" as "a\(b"?

2008-01-03 Thread John W. Krahn
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

Re: How to make "a(b" as "a\(b"?

2008-01-03 Thread John W. Krahn
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 he

Re: How to make "a(b" as "a\(b"?

2008-01-03 Thread Chas. Owens
On Jan 2, 2008 11:11 PM, Murali <[EMAIL PROTECTED]> wrote: > Hi, > > 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 wh

Re: How to make "a(b" as "a\(b"?

2008-01-04 Thread Murali
On Jan 3, 6:32 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > On Jan 2, 2008 11:11 PM, Murali <[EMAIL PROTECTED]> wrote:> Hi, > > > 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