in reply to Re: Verify string as ethernet address
in thread Verify string as ethernet address

":" and "-" are equivalent octet seperators. The presence of any other characters means the string isn't a valid ethernet address. With that change "dead beef is cool!" would match, but it shouldn't.
  • Comment on Re: Re: Verify string as ethernet address

Replies are listed 'Best First'.
Re: Re: Re: Verify string as ethernet address
by Koschei (Monk) on Jun 01, 2001 at 08:05 UTC
    Macintoshes tend to display their MAC address as a series of space separated octets. What you really want to do is to check that the octets are separated by a \W character. That way, you'll get "44:45 53,4f'2g;56" but not "dead beef is cool!". -- iain. <http://eh.org/~koschei/>
Re: Re: Re: Verify string as ethernet address
by suaveant (Parson) on May 30, 2001 at 21:57 UTC
    oooh, you're assuming users are typing in separators they are supposed to, or failing... that works too... :)
                    - Ant