I would like to compare two regular expressions in Python.
Basically, I need to test if one expression is included in the other one.
For example, is [AB]D included in [AB][CD]. or is ...K.. included in ...[KR]..
I tried something like the following but it doesn't work:
re.finditer(r"[AB][DF]",r"[AB]D")
re.finditer(r"[AB]D",r"[AB][CD]")
My expressions can have different size but a solution with same size expression would be great.
EDIT
All my regular expressions are prety simple.
They only contains "points", "square braquets" and "^".
. means "anything" (like * in real regexps)
[AB] means "A or B"
[^P] means "not P"
EDIT 2
Thanks for your answers and comments, I think I will generate the set of all string from one regexp and test them with the second regular expression.