added tests for generic regex method