I need help with regular expression.
I have very large collection of text files with different contents. But every file contains one hexadecimal key. Every key has exactly 16 hexadecimal digits ("E4 34 F1 FB..."
) and always begins with "00"
or "01"
. In some cases they have one separator character (":"
).
Here are some example keys:
00:C461F0538ECC84F1AF43DBBDC49E5DA3 00:F4F599D15353650F1566CFEB5CB891C1 011EC3991261BFD8D74BBCFE1E3108628C 003E05F7730347E43437F1FBCAB3A8B461 018FAE7FFB2DBB64F646F705525DEB25F8 00)339EDE5269DD018C2FD5338AD18C3A2F 00B8491FDF00C618A155350F47349E7B04
How to extract these keys from strings with a regular expression in .NET (VB.NET or C#)?
Here are a couple of strings for testing:
KAJSDF00ASLJKHFLAKJSDHFLAK01JSH00:C461F0538ECC84F1AF43DBBDC49E5DA3DFLKJAHSDFJAVHBEVBERJHVBQEJHRVBQJERBV JKLABDVJ01KBQLKJFBVQLEJKRBVL00:F4F599D15353650F1566CFEB5CB891C1QERBVJHQEBRVJHQBERFVHBQERVJHBQEJH RVBQJHERVBJHQBRVJHQEBRVJHWEBRV011EC3991261BFD8D74BBCFE1E3108628CWKBERVJHWERFGUQHERULIFHQW EIFH2FPO00I134FWFQWHEF34HFQREW018FAE7FFB2DBB64F646F705525DEB25F8F2347YQ3EFQO84R93U48UY8RTU13 R1R0100910R14UYR891UYFR1UEF98U1FPH00)339EDE5269DD018C2FD5338AD18C3A2F138294FH190324FU134UF19834YF