Regexp lookbehind javascript

I have this regex that matches all that I need correctly (all email addresses are NOT inside the link):

/((?<!mailto:|=|[a-zA-Z0-9._%+-])[a-zA-Z0-9._%+-] +@ [a-zA-Z0-9.β€Œβ€‹-]+\.[a-zA-Z]{2,64}(?![a-zA-Z]|<\/[aA]>))/ 

Unfortunately, since javascript does not support lookbehind, it does not work in my web application. Is there a solution for this?

+6
source share
1 answer

By definition, you need to look to see if the start tag for the <a> link to the email address is.

You may try:

  • matches each email address and then make sure the email address is not inside the link programmatically

or

  • use AJAX to send data to your server and get the server to perform regular expression.
+3
source

Source: https://habr.com/ru/post/924843/


All Articles