Re: String replacement involving special characters.

2009-01-18 Thread Gunnar Hjalmarsson
Blue wrote: $string = "aaa ' ccc "; $string =~ s/'/bbb/eg; The above replaces the single-quotation mark with bbb. The result will be: aaa bbb ccc How do I modify it so that the single-quotation mark is replaced with \' (a backslash and a single-quotation mark) resulting in: aaa \' ccc Is ther

Re: String replacement involving special characters.

2009-01-18 Thread Mr. Shawn H. Corey
On Fri, 2009-01-16 at 10:56 -0800, Blue wrote: > $string = "aaa ' ccc "; > $string =~ s/'/bbb/eg; > > The above replaces the single-quotation mark with bbb. The result will > be: > aaa bbb ccc > > How do I modify it so that the single-quotation mark is replaced with > \' (a backslash and a single

String replacement involving special characters.

2009-01-18 Thread Blue
$string = "aaa ' ccc "; $string =~ s/'/bbb/eg; The above replaces the single-quotation mark with bbb. The result will be: aaa bbb ccc How do I modify it so that the single-quotation mark is replaced with \' (a backslash and a single-quotation mark) resulting in: aaa \' ccc -- To unsubscribe, e