You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reading pattern from HTML it is used directly as a regular expression, which is not correct. The spec says
The compiled pattern regular expression, when matched against a string, must have its start anchored to the start of the string and its end anchored to the end of the string.
This implies that the regular expression language used for this attribute is the same as that used in JavaScript, except that the pattern attribute is matched against the entire value, not just any subset (somewhat as if it implied a ^(?: at the start of the pattern and a )$ at the end).
That means native validation using pattern="\d{5}" only accepts exactly five numbers. But knockout validation will use this as a regular expression, which will accept anything that contains five numbers aynwhere. E.g. foo12345bar.
The text was updated successfully, but these errors were encountered:
When reading
pattern
from HTML it is used directly as a regular expression, which is not correct. The spec saysThat means native validation using
pattern="\d{5}"
only accepts exactly five numbers. But knockout validation will use this as a regular expression, which will accept anything that contains five numbers aynwhere. E.g.foo12345bar
.The text was updated successfully, but these errors were encountered: