If you know what you're looking for, you can still process the incoming
string with literals. For example, it's unknown what the incoming variable
'str' contains, but I know I want to convert backslashes to forward slashes.
So, dump 'str' into a replace while searching for a literal backslash.
Avoids the double escape issue.
--------------------------------------------------
var str = "C:\\tmp\\backup\\whatever";
main( str );
function main( str )
{
LogMessage( str.replace( /\\/g, "/" ) );
return(0);
}
-----------------------------------------------------------
Matt
------------------------------
Matt Lind
Animator / Technical Director
SOFTIMAGE certified instructor:
SOFTIMAGE|3D
SOFTIMAGE|XSI
Mantom, Chicago
Matt(at)Mantom.net
RE: Slashing back at RegExp
Date : Tue, 25 Oct 2005 17:50:24 +0000
To : XSI(at)Softimage.COM