Uncaught Syntax Error: Invalid regular expression : Invalid character class

93 views Asked by At

My Polymer.js code has the following input element (it is intended to accept email addresses that have an “@” symbol AND a domain eg. “.com”)

I have tried adding like this

but in chrome console I am getting this below error

Pattern attribute value ^[_A-Za-z0-9]+(.[_A-Za-z0-9]+)@[A-Za-z0-9-]+(.[A-Za-z0-9-]+)(.[a-zA-Z]{2,4})$ is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /^[_A-Za-z0-9]+(.[_A-Za-z0-9]+)@[A-Za-z0-9-]+(.[A-Za-z0-9-]+)(.[a-zA-Z]{2,4})$/v: Invalid character class

What syntax do I have wrong?

0

There are 0 answers