I'm trying to replace an input pattern with a unicode equivalent, something like ^[0-9\\p{L} _\\-\\.]{3,16}$ <input type="text" pattern="^[a-zA-Z0-9_\-\.]{3,16}$">
The form automatically handles this when you click submit, telling the user that the pattern was not matched. Is there a way for xregexp to take over the default pattern handling here or what is the best way to do this?
XRegExp('...pattern...').source will give you a native JS pattern that you can use elsewhere. But since the input element's pattern attribute takes a string and not JS, you'd have to set it via JS.
I'm trying to replace an input pattern with a unicode equivalent, something like
^[0-9\\p{L} _\\-\\.]{3,16}$
<input type="text" pattern="^[a-zA-Z0-9_\-\.]{3,16}$">
The form automatically handles this when you click submit, telling the user that the pattern was not matched. Is there a way for xregexp to take over the default pattern handling here or what is the best way to do this?