G
Gary Yngve
[Note: parts of this message were removed to make it a legal post.]
Ugh, just got bitten by trying to replace ' w/ \' in a string (backslash
apostrophe).
Turns out that \' is a regex interpolator, just like \1, \2, so
"a'b'c'd".gsub("'","\\'") did not work, nor did it with the 2nd param as
'\\\''.
The magic incantation from trial and error is:
"\\\\\'"
Yuck!
Online documentation could certainly be improved.
-Gary
Ugh, just got bitten by trying to replace ' w/ \' in a string (backslash
apostrophe).
Turns out that \' is a regex interpolator, just like \1, \2, so
"a'b'c'd".gsub("'","\\'") did not work, nor did it with the 2nd param as
'\\\''.
The magic incantation from trial and error is:
"\\\\\'"
Yuck!
Online documentation could certainly be improved.
-Gary