Ok so this is likely a ridiculously stupid question but I can't seem to find a workable answer so please forgive my ignorance if the answer is obvious. All I would like is a Regex which will match a hex value exactly 8 times. So I've tried something like this:
My Regex:
[0-9a-fA-F]{8}
Sample Input:
D651000000060D60FADF0DFCE080E020636263633534623231386339
Sample Failing Input (where my given regex matches when I don't want it to):
........@%........$dc073bcc-6aa5
Yet for some reason this wont work for me. From what I understand the {8}
should match the preceding regex 8 times...yet this doesn't seem to work in either C# or notepad++.
Thanks in advance!
Your question is slightly confusing as to if you want 6 hex characters, 8 times:
([0-9a-fA-F]{6}){8}
Or an 8 digit hex character:
[0-9a-fA-F]{8}
or [0-9a-fA-F]{4,8}
if you dont want to require 8 characters.
I would recommend testing on:
http://gskinner.com/RegExr/
If these don't get it, can you post a sample of the values you're trying to match (note that if you have these on multiple lines in notepad++ you also need to be looking for the newline characters)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With