I have a list of filenames which will have name like this :
ADB_FULL_REQ_XXXXXXXXXXXX_151004_01.dat
Where :
ADB_FULL_REQ_ is constant
XXXXXXXXXXXX is the computer's Mac Address
151004 represents the date in yyMMdd format
01 is 2 digits and maximum is 99
I will have to perform a search in the diretory which contains those files and check if any of them is invalid/valid.
I've tried to use RegEX with this pattern but Match.Success always return false :
Match match = Regex.Match(filename, @"^ADB_FULL_REQ_XXXXXXXXXXXX_(d\{6})_(d\{2}).dat")
Please show me what'm I doing wrong here? Thanks!
The mistake is not big:
^ADB_FULL_REQ_[a-fA-F0-9]{12}_(\d{6})_(\d{2}).dat
you used d\ instead of \d. Change it and this will work fine (I've added checking for MAC address).
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