> Hello All,
>
[quoted text clipped - 13 lines]
>
> Sisilla
replaceAll takes an Regex, and does a regex replacement. Try "\\\\'".
I don't know that it'll work, so you'll have to try that yourself.
Basically, what that does is passes in the string \\' to the regex
handler, which escapes the \, and passes the \' to the javascript.

Signature
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
Sisilla - 08 Nov 2007 19:38 GMT
Thank you, Daniel. It worked like a charm, and I really appreciate it.
Thanks,
Sisilla
Christian - 08 Nov 2007 19:53 GMT
Daniel Pitts schrieb:
>> Hello All,
>>
[quoted text clipped - 19 lines]
> Basically, what that does is passes in the string \\' to the regex
> handler, which escapes the \, and passes the \' to the javascript.
the first argument is a regexp not the second..
cargotype = cargotype.replaceAll(Pattern.quote("'"), "\\'");
should do the trick..
Daniel Pitts - 08 Nov 2007 19:59 GMT
> Daniel Pitts schrieb:
>>> Hello All,
[quoted text clipped - 24 lines]
> cargotype = cargotype.replaceAll(Pattern.quote("'"), "\\'");
> should do the trick..
The second one is the regex replacement, which isn't a normal string
either. \1 represents the first captured group, etc...

Signature
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>