Skip to content

Commit 1ddd6b1

Browse files
rheonenicksterx
authored andcommitted
Fixing MacAddress Regular expression (#55)
Associated with #54 This is a stop gap quick fix, I'd like to attempt to optimize, and possibly group the responses. Not to mention some more testing...
1 parent 411dd23 commit 1ddd6b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Arcus/MacAddress.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class MacAddress : IEquatable<MacAddress>,
5252
/// <para>this regular expression pattern is expected to be used in matches ignoring case</para>
5353
/// </remarks>
5454
public const string AllFormatMacAddressPattern =
55-
@"^[\dA-F]{2}([ -:]?)(?:[\dA-F]{2}\1){4}[\dA-F]{2}$|^(?:[\dA-F]{4}\.){2}[\dA-F]{4}$|^(?:[\dA-F]{3}\.){3}[\dA-F]{3}$";
55+
@"^(?:[0-9A-F]{2}([-: ]?))(?:[0-9A-F]{2}\1){4}[0-9A-F]{2}$|^(?:[0-9A-F]{4}\.){2}[0-9A-F]{4}$|^(?:[0-9A-F]{3}\.){3}[0-9A-F]{3}$";
5656

5757
/// <summary>
5858
/// MAC Address Regular Expression pattern for matching the "common" six groups of two uppercase hexadecimal digits

0 commit comments

Comments
 (0)