flightdm has asked for the wisdom of the Perl Monks concerning the following question:
but... my Perlish soul yearns for something more - you know, prettier. Isn't there some magic look-around regex that could do it all in one pass? I've been fiddling and fiddling with it, well past the point of practicality, and now I just want to know if it's doable.s/(?:^\t|\t$)/-=-|1|-=-/g; s/([^"])(?:\t")/$1-=-|2|-=-/g; s/(?:"\t)([^"])/-=-|3|-=-$1/g; s/"\t"/-=-|4|-=-/g; s/\t//g; #...and then the obvious Opposite Thing
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex for replacing a character "not next to" another character
by BrowserUk (Patriarch) on Nov 04, 2016 at 01:42 UTC | |
by flightdm (Acolyte) on Nov 04, 2016 at 01:58 UTC | |
|
Re: Regex for replacing a character "not next to" another character
by tybalt89 (Monsignor) on Nov 04, 2016 at 01:36 UTC | |
by LanX (Saint) on Nov 04, 2016 at 07:50 UTC | |
by tybalt89 (Monsignor) on Nov 04, 2016 at 11:00 UTC | |
by LanX (Saint) on Nov 04, 2016 at 11:36 UTC |