#!/usr/bin/perl -w use strict; my $d = "[0-9A-Fa-f]"; my $dd = "$d$d"; while () { /($dd([:-])$dd(\2$dd){4})/o && print $1, "\n" } __END__ My MAC address is 00-00-00-00-00-00 over there, and it's 00:00:00:00:00:00 over here, and the date/time happens to be 2001-05-25-15:27. Note that 00:00-00:00-00:00 isn't really valid. Oh, and I have one address of DE:AD:BE:EF:21:12.