I want to find User Principal names inside all sort of strings for a C# tool to anonymize customer specific data.
I found this one:
(?[^@]+)@(?(?:[a-z0-9]+.)+[a-z]+)
But in a string like this:
f-4af0-86e8-01439a0ae52a\",,\"Active\",\"10/30/2018 9:05:35 AM\",\"SingleSession\",\"Desktop\",,\"10/29/2018 2:35:06 PM\",,\"655952\",\"DOM\na010318\",\"na010318\",\"DOM\n010318\",\"S-1-5-21-2052699199-3915784498-1582209984-1157056\",\"user.a@domain.acc.local\",\"Primary\",\"c46b084c-6df3-47dd-9d3e-8e17f855c7fe\""
It matches the entire part before the UPN (the first space, because it matches the word I guess.
How can I re-write the regular expression to only find the e-mail/UPN within this string?
Thanks