Regex utility module.


Given a pattern string with a glob, create actual regex pattern.

To require > 0 length glob, change the “*” to “.+”. This is to handle strings like “*”. (The actual regex would probably be “.*”, except that we don’t want to match zero-length usernames before the “@”.)

Special case the pattern ‘*’ to match 0 or more characters.

Parameters:pattern_string (str) – The pattern string of which to make a regex.
The pattern string, escaped except for the “*”, which is
transformed into “.+” (match on one or more characters).
Return type:str