I want to write a regex in re.VERBOSE
mode, but I'm not confident that I'll add the verbose part without error.
I remember that, theoretically, the equivalence of two regexes (without backreferences, at least) can be found by generating their automata and trying to find a graph bijection. But there's no instance method I can see for comparing regexes.
Is there a way to either generate the automaton of a regex or directly compare them, preferably with the standard library?
(I've already decided on a different solution to my problem, but this is still of interest to me.)