<div dir="ltr"><div>I need to so some input sanitizing for use against MySQL.</div><div><br></div>"This isn't much of a \"test string\"; it'll have to do though."<br><div><br></div><div>Tried using the RE modules (yes, quad escaping crap) but the replacement part for the back-references isn't working correctly. Instead of getting "\;" it's actually interpreting the backslash all the way down. At least it's not turtles all the way down.</div>
<div><br></div><div>So I went with a replacement of <92,"\\\\1"> thinking I'd get around it, but it didn't work either. Closest I got was "\\;" in the string which is still incorrect.</div>
<div><br></div><div>So regexp is deprecated in favor of RE, but yet RE's pretty shitty for this kind of thing. I suppose I can just walk the list directly but then it's incremental string-building.</div><div><br>
</div><div>Anyone have a "here dummy, you missed this NIF/built-in ... just use that" to throw my way?</div><div><br></div><div>TIA!</div><div><br></div><div><div><font face="courier new, monospace">122> re:replace("This isn't much of a \"test string\"; it'll have to do though.", </font><span style="font-family:'courier new',monospace">"([';\"])", </span><span style="font-family:'courier new',monospace"> <<92,"\\\\1">>, </span><span style="font-family:'courier new',monospace"> [global, {return, binary}]).</span></div>
<div><font face="courier new, monospace"><<"This isn\\'t much of a \\\"test string\\\"\\; it\\'ll have to do though.">></font></div></div><div><br></div><div><br></div><div><br></div>
</div>