luchuanc
asked on
Pattern Match for MAC address
Hi
I have 2 strings:
00-0F-B7-21-22-44:ess-Mide nt-Wireles s
00:0F:B7:21:20:A8:ess-Mide nt-Wireles s
How to create a pattern match for them using the rules in: http://technet.microsoft.com/en-us/library/cc755272(WS.10).aspx
Is the following correct?
00\-|\:0F\-|\:B7\-|\:22|0\ -|\:4|8:es s-Mident-W ireless
Thanks,
Luchuan
Thanks,
Luchuan
I have 2 strings:
00-0F-B7-21-22-44:ess-Mide
00:0F:B7:21:20:A8:ess-Mide
How to create a pattern match for them using the rules in: http://technet.microsoft.com/en-us/library/cc755272(WS.10).aspx
Is the following correct?
00\-|\:0F\-|\:B7\-|\:22|0\
Thanks,
Luchuan
Thanks,
Luchuan
how about
([0-9A-F]{2}[:-]){5}ess-Mi dent-Wirel ess
([0-9A-F]{2}[:-]){5}ess-Mi
I made the assumption you would want to match other hex delimited values ending with 'ess-Mident-Wireless'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@nullsquid though this NPS regEx syntax is new to me, just thinking abt any regEx engine impl, i wonder how the matcher would figure out the LHS and RHS of an or statement without bounds.
E.g. according to my understanding
00\-|\:0F\-|\:B7\-|\:21\-| \:22|0\-|\ :4|A4|8:es s-Mident-W ireless
would match "00-" as well!
E.g. according to my understanding
00\-|\:0F\-|\:B7\-|\:21\-|
would match "00-" as well!
00\-|\:0F\-|\:B7\-|\:21\-| \:22|0\-|\ :4|A4|8:es s-Mident-W ireless
will also match...
"8:ess-Mident-Wireless"
will also match...
"8:ess-Mident-Wireless"
@sdstuber however stupid this sounds, http://technet.microsoft.com/en-us/library/cc755272%28WS.10%29.aspx doesn't list ranged expressions ([0-9]) as supported!
([0-9A-F]{2}[:-]){5}ess-Mi dent-Wirel ess
^^^^^^
([0-9A-F]{2}[:-]){5}ess-Mi
^^^^^^
it doesn't in the character list column but it uses them in the examples so I made the assumption they were supported
For example:
\d Matches a digit character (equivalent to [0-9]).
if they really aren't supported though (yuck) then change
[0-9A-F]
to
[0123456789ABCDEF]
For example:
\d Matches a digit character (equivalent to [0-9]).
if they really aren't supported though (yuck) then change
[0-9A-F]
to
[0123456789ABCDEF]
ASKER
In trying to get these to work I found there is a bug in Windows NPS:
http://support.microsoft.com/kb/2599437
Things only worked after I applied this hotfix.
I also noticed I had incorrectly posted the MACs - both use a "-" as separator not ":"
final code:
00-0F-B7-21-22-44:ess-Mide nt-Wireles s
00-0F-B7-21-20-A8:ess-Mide nt-Wireles s
00[-]0F[-]B7[-]21[-](20|22 )[-](44|A8 ):ess-Mide nt-Wireles s
http://support.microsoft.com/kb/2599437
Things only worked after I applied this hotfix.
I also noticed I had incorrectly posted the MACs - both use a "-" as separator not ":"
final code:
00-0F-B7-21-22-44:ess-Mide
00-0F-B7-21-20-A8:ess-Mide
00[-]0F[-]B7[-]21[-](20|22
00\-|\:0F\-|\:B7\-|\:21\-|
more correct?