test-regex: isolate the bug test code