This was just working a day ago but now throwing exception. I've pasted regex into online verifier and it looks good?
What am I missing?
<input type="text" class="form-control" name="nickname" id="nickname" value="Alicia"
pattern="[\w\s\-\(\)\!\,\.]{3,45}">
Pattern attribute value
[\w\s\-\(\)\!\,\.]{3,45}
is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression:/[\w\s\-\(\)\!\,\.]{3,45}/
: Invalid escape
Thanks for the help!
Casey
This was just working a day ago but now throwing exception. I've pasted regex into online verifier and it looks good?
What am I missing?
<input type="text" class="form-control" name="nickname" id="nickname" value="Alicia"
pattern="[\w\s\-\(\)\!\,\.]{3,45}">
Pattern attribute value
[\w\s\-\(\)\!\,\.]{3,45}
is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression:/[\w\s\-\(\)\!\,\.]{3,45}/
: Invalid escape
Thanks for the help!
Casey
Share Improve this question edited Sep 22, 2016 at 0:15 Phil 165k25 gold badges262 silver badges267 bronze badges asked Sep 21, 2016 at 23:58 cphcph 4582 gold badges6 silver badges24 bronze badges 01 Answer
Reset to default 6Looks valid to me though Chrome does indeed plain.
In any case, you don't need to escape all those characters within a character class. You should be able to use
pattern="[\w\s()!,.-]{3,45}"
which seems to work ok for me.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744710656a4589322.html
评论列表(0条)