Move from assertEndState to assertRegExp for all tests. Fix one problem with infinity repeats and resetting of matches