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

database - How many Observations in SAS Sample Data Output -

emulation - Android map show my location didn't work -

ios - how to query based on pfobject/pfuser associated with another pfobject in parse.com? -