Issue
In HTML, the pattern="" attribute allows regex. However, I can't find a list of HTML regex parameters. Thus, I'm wondering if it's the same as JS.
Solution
Yes, from the docs for pattern
attribute
A regular expression that the control's value is checked against. The pattern must match the entire value. Use the title attribute to describe the pattern to help the user. This attribute only applies when the value of the type attribute is text, search, tel, url, email, or password. The regular expression language is the same as the JavaScript RegExp algorithm, with the 'u' parameter that makes it treat the pattern as a sequence of unicode code points. The pattern is not surrounded by forward slashes.
Emphasis mine
Answered By - Jamiec
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.