in reply to checking interpreted string for escapes versus literal backslashes?
First, do a substitution like s/\\\\/\\x5c/g or something like that. Then, it's easy to match unescaped charaters, as you only have to check if there's a backslash behind it or not. This substitution can later be reversed if it's needed.
(Using a double backslash as an escape sequece for backslashes is a very silly thing, even though C does that and everyone since blindly follows. There should have been an single-letter escape sequence like \B for backslash, to avoid all this exponential backlash growth thing.)
Update 2008 aug 29: see also Replace only unescaped metachars.
Update 2009 mar 31: see also Re^2: Game Nicknames to HTML.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: checking interpreted string for escapes versus literal backslashes?
by Anonymous Monk on Mar 28, 2006 at 16:23 UTC | |
by ambrus (Abbot) on Mar 28, 2006 at 16:34 UTC |