Start a new topic

Regex to disregard certain characters in an email

I need your help with extracting correct email with a regular expression in an annotation. Here is a raw HTML that I get :

 

</a><script>var XutJPVbvZ = 'sales@some##thing.com'; var XutJPVbvZ = XutJPVbvZ.split('#'); document.getElementById('XutJPVbvZ').innerHTML = XutJPVbvZ[0]+XutJPVbvZ[2]+XutJPVbvZ[1]; document.getElementById('XutJPVbvZ').href = 'mailto:'+XutJPVbvZ[0]+XutJPVbvZ[2]+XutJPVbvZ[1]; </script> </div>

 I match an email with this expression:


[a-zA-Z0-9-_.]+@[a-zA-Z0-9-_.]+[a-zA-Z]+[a-zA-Z0-9-_.]+

What I get is this: sales@some##thing.com

How to make regex return an email without two # special characters in the middle of this email address?

 

Thanks

Login to post a comment