Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Verify string as ethernet address

by fs (Monk)
on May 30, 2001 at 21:52 UTC ( [id://84326]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://84326]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-26 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found