regex - Invalid regular expression HTML Pattern -


this regex:

pattern="[^\!\#\$\%\^\&\*\'\|\"]{8}" pattern="[^!#$%^&*'|"]{8}" 

how invalid in html input tag? want symbols restricted in textbox

<input placeholder="something" type="text" required autofocus ng-model="somedata" pattern="[^\!\#\$\%\^\&\*\'\|\"]{8}"> 

i think should pattern=\"[^!#$%^&*'|"]{8}\"

you should escape literal double quote outside [] instead of inside.

demo: https://regex101.com/r/up5pc6/1


Comments

Popular posts from this blog

javascript - Feed FileReader from server side files -

java - How to create your own button and Use it with Scene Builder for javafx -

c++ - Drawing a circle in directx 9 -