Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
You could try to compile both regexes with use re 'debug'; and compare those outputs:
The indented part is the interesting one. If two regexes show the same output in the indented part, they will match the same pattern (the reversion isn't always true, because (a|b) and (b|a) behave the same in some regexes, and behave differently in others (not quite sure, but you can construct cases with alternation where the order somtimes matter, and somtimes not)). I don't know if you can access this information from inside perl, perhaps with one of the B:: modules, if not you can still use backticks or qx to execute a command line like the one I showed. In reply to Re: Compare two regex patterns
by moritz
|
|