Hi,
I am having some issues using gsub to replace double slashes. The problem is this:
I built a small script to parse YAML files for a directory location, and then to use that to glob the files in that directory. Say this is the directory it finds:
C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\ActionScript 3.0\Classes
This is a Windows directory, and the backslashes are escaped by YAML parser, so this really gets loaded from parser as:
C:\\Program Files\\Adobe\\Adobe Flash CS3\\en\\Configuration\\ActionScript 3.0\\Classes
To use this directory, I wanted to gsub away these double slashes:
path.gsub('\\','/')
This call replaced most of the double backslashes in the path, though the script still did not work. When I looked at what the path had become, I found that there was still one backslash that had not been replaced by gsub:
\en
What explains this strange behavior?