Refactoring: Regex defs as function with parameters
More test scenarios