Twisten wrote:well i'll try and give a simple example (its very late):
if i recall correctly this case gives a problem
RegExReplace $r, $s, "["`'](?=\d+)", " ";
are you saying that this will work fine, where $p=["`'](?=\d+):
RegExReplace $r, $s, $p, " ";
still i wasn't thinking that clearly with that idea since:
set $p, ["`'](?=\d+);
is subject to the same parsing, its seems the only way to make it work is to turn
["`'](?=\d+)
to
"[""`'](?=\d+)"
which feels just plain wrong to read when looking at the pattern and would even be misleeding if the " wasn't in [] .
if you're expecting the commands last parameter and it started with a " and you have a "; at the end is it neccessary to count pairs of "
I see 2 workable ways:
(1) double all " inside "..."
Code: Select all
Set $p, "[""`'](?=\d+)";
RegExReplace $r, $s, $p, " ";
It might feel wrong but it is pretty standard I think.
(2) 2 steps with a replacement
Code: Select all
Set $p, [@`'](?=\d+);
Replace $p, $p, @, """";
RegExReplace $r, $s, $p, " ";