func globToRegex did not handle a trailing backslash and for inputs like "anything\" it panicked with index out of range. This PR fixes the issue. In the case of trailing backslashes, globToRegex now returns a proper error that is handled by the caller.