bplegend has asked for the wisdom of the Perl Monks concerning the following question:
$line = sprintf qq{Test #1 'Show me Waynes world','Jennys Basketball s +hoes'\n}; $line =~ s/(['"]).+?(['"])/$1SSS$2/g; print $line; $line = sprintf qq{Test #2 'Show me Wayne\'s world','Jenny\'s Basketba +ll shoes'\n}; $line =~ s/(['"]).+?(['"])/$1SSS$2/g; print $line; __END__ Test #1 'SSS','SSS' Test #2 'SSS's world'SSS'Jenny'SSS'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: skip over an escaped single quote
by GrandFather (Saint) on Jan 30, 2011 at 01:59 UTC | |
|
Re: skip over an escaped single quote
by eyepopslikeamosquito (Archbishop) on Jan 30, 2011 at 01:49 UTC | |
|
Re: skip over an escaped single quote
by toolic (Bishop) on Jan 30, 2011 at 01:48 UTC | |
|
Re: skip over an escaped single quote
by wind (Priest) on Jan 30, 2011 at 08:28 UTC | |
|
Re: skip over an escaped single quote
by bplegend (Novice) on Jan 30, 2011 at 02:07 UTC | |
by Jim (Curate) on Jan 30, 2011 at 16:24 UTC | |
|
Re: skip over an escaped single quote
by JavaFan (Canon) on Jan 30, 2011 at 17:57 UTC | |
by Jim (Curate) on Jan 31, 2011 at 00:07 UTC |