I need to make a VBA script that will let me put in any MAC address (input formats listed below) and then put out one of several formats.
I have been able to do most of the VBA so far but the only problem is that I can't get a regex pattern to match the dots, dashes, colons or other separators.
This is the function that I am using to try to isolate the problem with the regex.
This function will take the text in string and remove only the first ":". I have tried to add an astrik to the end (e.g. (?:[^0-9a-fA-F])*) but that is actually causing it not to find any of the colons.
Here are some examples of what I am getting now and what I would like to get with the function working correctly.
Current Results
00:11:22:33:44:55 - 0011:22:33:44:55
Ideal Results
00:11:22:33:44:55 - 001122334455
00-11-22-33-44-55 - 001122334455
00.11.22.33.44.55 - 001122334455
0011.2233.4455 - 001122334455
Thanks for all the help. Let me know if you have any questions!
Bookmarks