Quote:
Originally posted by beetle
var pattern = /mailto:([^"]+)"/;
or
var pattern = /mailto:(\.+?)"/;
Either should work
|
Hmm, /mailto:([^"]+)"/ should work perfectly, but just to be sure, make it case insensitive.
/mailto:(\.+?)"/ on the other hand shouldn't work - you escape the fullstop from being any character to being just a fullstop. You'll not catch any valid address that way.
Code:
// This would be better:
var pattern=/mailto:(.+?)"/i;
// But I really suggest you do it in this way instead:
var pattern=/mailto:([-_a-z~.]+@[-_a-z~.]+)"/i;
/* Why? Because that way, even though you'll not get full email address validation out of it, you'll at least make sure you get a full address. */