Updated regex to match any char where a directory separator would be.
Found no regex character class that would work for both windows and mac os x. Character classes starting with [^ work differently.