title: Actionscript 3 : Problem escaping "\\" character in full file path
body: <p><strong>I am finding this task challenging in AS3.</strong></p>
  
  <p>Excuse me if I am missing something basic/simple or some builtin method which can do this. I am not well versed with RegExp.</p>
  
  <p>I have a <strong>DYNAMIC</strong> string representing full file path which looks exactly like "<strong>d:\temp\abc.doc</strong>". I want to extract the <strong>filename</strong> part from complete string e.g. <strong>abc.doc</strong>. </p>
  
  <p>I am aware of techniques like using "fullPath.lastIndexOf("\\")" or regular expressions. The problem is it doesn't seem to work if you have "\" in your path. It works with "/". The path being dynamic can't be manipulated to replace "\" with "/" or any other delimiter. My interpretation is that since "\" is used to escape characters - ANY character appearing AFTER "\" is ignored by <strong>actionscript</strong>. e.g.</p>
  
  <pre><code>var fullPath:String = "A\B\C";
  
  trace(fullPath.length); //**RETURNS 3** since "\B" &amp; "\C" 
                          // are being treated as SINGLE chars
  
  var bSlash:int =  fullPath.lastIndexOf("\\") //RETURNS **-1**
  </code></pre>