Regular expression

G

Guest

how do i create an regular expression to validate a MAC Address:
(##-##-##-##-##) 00-90-F5-07-7F-9B

the # could be either a number or character.

many thanks
 
H

Hans Kesting

huzz said:
how do i create an regular expression to validate a MAC Address:
(##-##-##-##-##) 00-90-F5-07-7F-9B

the # could be either a number or character.

many thanks

easy:
^[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}$
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top