[olug] String parsing question

sul3n3t at cox.net sul3n3t at cox.net
Thu Oct 6 23:46:19 UTC 2005


Adam,

I'm no expert, but what about:
sed -e 's/[a-zA-Z0-9, ]*<\([a-zA-Z0-9 at .]*\)>/\1 /g'

I tested this and it seems to work ok.

Justin Cummins


> From: Adam Haeder <adamh at omaha.org>
> Date: 2005/10/06 Thu PM 05:59:30 EDT
> To: Omaha Linux User Group <olug at olug.org>
> Subject: [olug] String parsing question
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hail, all you regular expression gurus:
> 
> What's the best (fastest) way to get from this string:
> 
> User 1 <user1 at a.com>, User 2 <user2 at a.com>, User 3 <user3 at a.com>
> 
> to this:
> 
> user1 at a.com user2 at a.com user3 at a.com
> 
> Consider that there could be x number of addresses on the line, so I can't
> always assume 3.
> 
> I'm racking my brains against sed and haven't come up with anything
> workable yet. TIA
> 
> - --
> Adam Haeder
> Vice President of Information Technology
> AIM Institute
> adamh at omaha.org
> (402) 345-5025 x115
> PGP Public key: http://www.haederfamily.org/pgp.html
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
> 
> iD8DBQFDRZ5CbHC3IXlHqBQRAnK0AJoC3izYLooFAFokFgP2215idzS21gCePiFi
> Ik3rvn1lnF7oF8JwEGOtYo8=
> =EHGV
> -----END PGP SIGNATURE-----
> _______________________________________________
> OLUG mailing list
> OLUG at olug.org
> http://lists.olug.org/mailman/listinfo/olug
> 




More information about the OLUG mailing list