in reply to Regex matching on anywhere but the beginning or end of a line
In a similar vein, you could match the characters before and after using a character class that says "anything but quote", then put those into the replacement string like this:
$x =~ s/([^"])"([^"])/$1""$2/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regex matching on anywhere but the beginning or end of a line
by xmath (Hermit) on Feb 23, 2003 at 00:19 UTC | |
by steves (Curate) on Feb 23, 2003 at 00:32 UTC |