Convert a glob to a regular expression