matchmaker icon indicating copy to clipboard operation
matchmaker copied to clipboard

Regexp breaks when containing curly braces

Open DannyBen opened this issue 10 years ago • 0 comments

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.

DannyBen avatar Nov 30 '14 12:11 DannyBen