http://www.perlmonks.org?node_id=531683


in reply to Testing regex equivalence

you could use "b" or whatever it is to compile a perl regex into token form. equivalent regular expressions (e.g. /.../ and /.{3}/ should end up the same. as for more complicated regular expressions, they may end up being equal depending on the dataset being fed in. the only way to test this kind of equivalence is to run both on the dataset in question.
the hardest line to type correctly is: stty erase ^H