I'm not sure where you're wanting to pull the emails and urls from, if it's from HTML (sockets), then you could probably use something like: $regex(%text,/<(\S+?@\S+?\.\S+?)>/g)
That would consider: <email@host.com> as an email, but not: <email@localhost> or <email @ localhost> of course if you want to include spaces as the true emails, you could use something like: .*? instead of those \S+?
On the other hand, if you're just parsing plain text on IRC, something a little more tricky then, there's stuff you could match for, but it really depends. Like: [^<@, ]* and stuff, I don't have enough time to go look up all the allowed characters for each protocol and what not, but if you're parsing plain text through something like "on text" on IRC, you could probably use something like: $regex($1-,/([^<@> ]*@[^<@> ]*\.[^<@> ]*)/g)
Anyway, good luck.
Quick example:
//tokenize 32 this is a test <a@bcd.com> hehe <afd@hij.hehe.com> also haha.yeah@blah.com | echo -a $regsubex($1-,/([^<@> ]*@[^<@> ]*\.[^<@> ]*)/g,\t)