protected static String[] parseMACs (String text)
    {
        if (text == null) {
            return new String[0];
        }

        Matcher m = MACRegex.matcher(text);

        ArrayList<String> list = new ArrayList<String>();
        while (m.find()) {
            String mac = m.group(1).toUpperCase();
            mac = mac.replace(':', '-');

            // "Didn't you get that memo?" Apparently some people are not
            // up on MAC addresses actually being unique, so we will ignore those.
            //
            // 44-45-53-XX-XX-XX - PPP Adaptor
            // 00-53-45-XX-XX-XX - PPP Adaptor
            // 00-E0-06-09-55-66 - Some bogus run of ASUS motherboards
            // 00-04-4B-80-80-03 - Some nvidia built-in lan issues
            // 00-03-8A-XX-XX-XX - MiniWAN or AOL software
            // 02-03-8A-00-00-11 - Westell Dual (USB/Ethernet) modem
            // FF-FF-FF-FF-FF-FF - Tunnel adapter Teredo
            // 02-00-4C-4F-4F-50 - MSFT thinger, loopback of some sort
            // 00-00-00-00-00-00(-00-E0) - IP6 tunnel
            if (mac.startsWith("44-45-53")) {
                continue;
            } else if (mac.startsWith("00-53-45-00")) {
                continue;
            } else if (mac.startsWith("00-E0-06-09-55-66")) {
                continue;
            } else if (mac.startsWith("00-04-4B-80-80-03")) {
                continue;
            } else if (mac.startsWith("00-03-8A")) {
                continue;
            } else if (mac.startsWith("02-03-8A-00-00-11")) {
                continue;
            } else if (mac.startsWith("FF-FF-FF-FF-FF-FF")) {
                continue;
            } else if (mac.startsWith("02-00-4C-4F-4F-50")) {
                continue;
            } else if (mac.startsWith("00-00-00-00-00-00")) {
                continue;
            }

            list.add(mac);
        }

        return list.toArray(new String[0]);
    }
protected static String [ ] parseMACs ( String text ) { if ( text == null ) { return new String [ 0 ] ; } Matcher m = MACRegex . matcher ( text ) ; ArrayList < String > list = new ArrayList < String > ( ) ; while ( m . find ( ) ) { String mac = m . group ( 1 ) . toUpperCase ( ) ; mac = mac . replace ( ':' , '-' ) ; if ( mac . startsWith ( "44-45-53" ) ) { continue ; } else if ( mac . startsWith ( "00-53-45-00" ) ) { continue ; } else if ( mac . startsWith ( "00-E0-06-09-55-66" ) ) { continue ; } else if ( mac . startsWith ( "00-04-4B-80-80-03" ) ) { continue ; } else if ( mac . startsWith ( "00-03-8A" ) ) { continue ; } else if ( mac . startsWith ( "02-03-8A-00-00-11" ) ) { continue ; } else if ( mac . startsWith ( "FF-FF-FF-FF-FF-FF" ) ) { continue ; } else if ( mac . startsWith ( "02-00-4C-4F-4F-50" ) ) { continue ; } else if ( mac . startsWith ( "00-00-00-00-00-00" ) ) { continue ; } list . add ( mac ) ; } return list . toArray ( new String [ 0 ] ) ; }
Look through the text for all the MAC addresses we can find.