Translate a glob pattern to a regular expression