Trying to figure out the Regex pattern to match if an email contains a Guid, e.g.
The Guid could potentially be anywhere before the @, e.g.
I use this to find Guids
Regex isGuid = new Regex(@"^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$", RegexOptions.Compiled);
A lazy variant would be
([0-9a-f-]{36}).*?@
It is easy to read and I bet it matches 99,99% of all cases ;) But then in 0,00001% of all cases sombody could have an email address that fits in a GUID scheme.
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