2

is this format ?

wpa-bssid 00:1a:2b:3c:4d:5e

or

wpa-bssid 00:12:26:36:48:58

can I use this regex?

^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$

any help woulb be appreciated

Mazdak
  • 105,000
  • 18
  • 159
  • 188
The Man
  • 407
  • 1
  • 7
  • 19

1 Answers1

3

Its OK and more precise you can use :

([0-9A-F]{2}([:-]|$)){6}
Mazdak
  • 105,000
  • 18
  • 159
  • 188
  • 1
    However, you should be aware that some systems might not return leading zeroes. For example, iOS 13 returned "8:96:d7:...", and the regex failed. – rpitting Apr 08 '20 at 09:31