I would like to check if a string matches part of a family of strings described by a regular expression.
The desired behavior would be something like:
>>> re.findall("hi", "h[ia]t")
["hi"]
>>> re.findall("at", "h[ia]t")
["at"]
>>> re.findall("hat", "h[ia]t")
["hat"]
>>> re.findall("cat", "h[ia]t")
[]
but the second argument to re.findall() is interpreted literally.
Of course in the simple example above I could explicitly check against both "hit" and "hat", but for more complicated expressions that seems unwieldy.