Regex Examples

What’s the best (fastest) way to get from this string:

User 1 user1 [at] a [dot] com, User 2 user2 [at] a [dot] com, User 3 user3 [at] a [dot] com

to this:

user1@a.com user2@a.com user3@a.com
 sed -e 's/[a-zA-Z0-9, ]*<\([a-zA-Z0-9@.]*\)>/\1 /g'
#!/usr/bin/perl

while(<STDIN>) {
 $_=~s/[^<]*<([^>]*)>/$1 /g;
 print;
} 
 
howto/regex.txt · Last modified: 2005/10/09 14:23 by bw
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki