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 -

How to Change swipe Tab Title color in java Android -

Using globs in Perl replace one liner in TCL script -