[geeks] regex question, I suppose...

Peter L. Wargo geeks at sunhelp.org
Fri Aug 24 00:56:28 CDT 2001


On Fri, 24 Aug 2001, Dan Debertin wrote:

> Here's what I came up with, just banging stuff out off the top of my head:
> 
> sed
> 's/^\([0-9a-f]\{2\}\)\([0-9a-f]\{2\}\)\.\([0-9a-f]\{2\}\)\([0-9a-f]\{2\}\)\.\([0-9a-f]\{2\}\)\([0-9a-f]\{2\}\)/\1:\2:\3:\4:\5:\6/'

VERY sweet... 

Reminds me of the time I watched a scientist trying to do a search &
replace on a 5M sequence file using vi over NFS... He came to me in
frustration after 2 hours had passed... I showed him a single-line sed
that did it in 18 seconds...  Sometimes, the old ways are the best.

-Pete





More information about the geeks mailing list