javascript - RegEx for e-mail address outside code comment -
using regex, trying match e-mail address outside of code comment.
for example, string this:
/** * hello world * comment info e-mail @ test@email.com */ want match this@email.com
so in case, want return 'this@email.com'. regex formula use in case?
regular expressions seen magic language need text string if knew incantation. it's not that, , shouldn't let progammer-sense subverted idea. core language should heavy lifting, leaving regex patterns detailed work
it's unclear whether need perl solution or javascript one, or if you're equivocal. perl
how "match e-mail address outside of code comment"?
remove comments
this addressed in perlfaq6
search email addresses
you should use
regexp::common
module,regexp::common::email::address
. beware match defined internet message format standard, may rather more imagine "email address" be. it's lot morebob@example.com
see
email::address
if need process email addresses find
Comments
Post a Comment