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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -