ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Find And Run Robot

IMPORTANT: Sample mini group alias file for F&R - download here

<< < (2/4) > >>

nontroppo:
That regex will fail on several addresses (a few non-word characters are allowed, see http://www.remote.org/jochen/mail/info/chars.html for more), here is an improved version removing the problem, and also adding an optional subject line:

1000>>>email3>->email $$1 | mailto:$$1?subject=$$2>+>^([^@]+@.+\.[^\s]+)(?:\s?)([^\s]*)

(and it was me who asked for the <enter> changes ;))

Jibz:
Perhaps seems a bit overinclusive just to allow + and -, but whatever works for you :up:.

nontroppo:
Well, though not recommended, there are other officially valid characters according to the RFC's than + and -

<offtopic>I never knew about how useful + is in email addresses until recently, you can use it to tag mail addresses which nevertheless go into the same mailbox, e.g. [email protected] and [email protected] both get delivered to the same box ([email protected]) but allows you to distinguish / filter them</offtopic>

nontroppo:
OK, a version of that regex that is a bit more cautious, and fixes a small bug in the optional subject matching ;)

1000>>>email3>->email $$1 | mailto:$$1?subject=$$2>+>^([\w+-]+@[\w+-]+\.[\w+-]+)(?:\s?)(.*)

Jibz:
Looks good .. except does it work if there is more than one . in the domain part? like [email protected]?

And what about if there is a . in the local part? like [email protected]

I didn't know about the + thing either .. very handy indeed :Thmbsup:.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version