Need to check for windows and for posix file patterns. This regex could cause problems when a path contains `\` and `/`, but my guess is that `\` and `/` are treated as path separators. Is that fine ? If not, we may have to write logic similar to what node.js path module does. 

Do you think it may make sense to use the same logic that path.js uses in node - https://github.com/joyent/node/blob/master/lib/path.js#L61

Note that they seem to use completely different code paths for Windows and for Posix.