matchmaker
matchmaker copied to clipboard
Regexp breaks when containing curly braces
Trying to create validation for a phone field
Works: phone: ":regexp(/^\+\d+$/)"
Fails: phone: ":regexp(/^\+\d{10,15}$/)"
In addition, although this one is of less significance, this also fails: phone: ":regexp(/^\+(\d+)$/)"
In failed cases, PHP complains it cannot find the ending delimiter,
EDIT: I found the source of the problem, but not sure how to fix it without breaking other things. The reason for the failure is the fact that you give comma and parentheses a special treatment in the matcher() function. Would love if if this can be fixed.