RE: Slashing back at RegExp

Date : Tue, 25 Oct 2005 14:26:21 -0500
To : xsi(at)Softimage.COM
From : "Matt Lind" <speye_21(at)hotmail.com>
Subject : RE: Slashing back at RegExp
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

Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.