in reply to Re^2: stripping out email address from string
in thread stripping out email address from string
It's still not perfect (using regexes to determine the validity of an email address is a fool's game), but should be close enough for most purposesWith 5.10 regexes, a regexp to match email addresses isn't too hard.
However, a typical string contains many "valid" email addresses. See, according to the RFC, an email address doesn't really have to have an '@' sign. A string of ASCII letters is a valid email address. (Your typical MTA will try to deliver it locally). Just grabbing what's between < and > is more likely to produce what the user wants than throwing a correct email address regexp against it.
|
|---|