The easiest way would be to use grep with PCRE:
$ ifconfig -a | grep -Po 'HWaddr \K.*$'74:d4:35:84:34:13 grep -Pwill enable us to useperlcompatible Regexgrep -owill only take the matched portion of the lineWe have matched
HWaddrbefore our desired match (MAC addresses) and then discardHWaddrby\Kto print only the MAC addresses.
@Helio has mentioned an important point, this is highly dependent on your language i.e. locale settings. To overcome that you can use the C locale (uses ASCII character set) for this command only:
$ LANG=C ifconfig -a | grep -Po 'HWaddr \K.*$'74:d4:35:84:34:13