I have the following regex that checks for multiple types of email address inputs
[\W"]*(?<name>.*?)[\"]*?\s*[<(]?(?<email>\S+@[^\s>)]+)[>)]?
I got this off How do I regex a name and an email out of the 3 major email clients in ruby?
The problem i am facing is that while using this in javascript i get an error "Uncaught SyntaxError: Invalid regular expression: /[\W"]*(?"<name>".*?)[\"]*?\s*[<(]?(?"<email>"\S+@[^\s>)]+)[>)]?/
: Invalid group "
I spent an entire day trying to fix this and i found out that the problem has something to do with lookbehind That javascript doesn't support
I'm very bad at regex expressions and need some advice. Can someone please point me in the right direction.
PS: I am trying to make this function to integrate it with jquery validate plugin