def literals(choices, prefix='', suffix=''):
 return '|'.join((((prefix + re.escape(c)) + suffix) for c in choices.split()))

def literals ( choices , prefix = '' , suffix = '' ) : return '|' . join ( ( ( ( prefix + re . escape ( c ) ) + suffix ) for c in choices . split ( ) ) )
create a regex from a space-separated list of literal choices .