Huh, this is interesting. Apparently you can design a regex with the OR modifier. For example, this input with this regex:

String input = "methodsTestingPurposesStringForTestingFor";
String regex...