Don't use unnecessary (and unescaped) regex

There are two issues with the original code:

 1. It doesn't escape the path for use in regex
 2. A regex really is unnecessary for testing if a string [starts with a substring](http://stackoverflow.com/questions/646628/javascript-startswith)