Here is what I have which is likely a stroke of luck because this is probably my first week of messing around with regex:
((?<lastname>(?![CN=]))(?<firstname>\w*))
Here is an example string:
CN=Doe\, John,OU=Windows10WS,OU=Employees,OU=Users,OU=AFR,DC=org,DC=bssz,DC=com
CN=Doo\, Scooby,OU=WindowsSRV,OU=Manager,OU=Users,OU=NYC,DC=org,DC=nyc,DC=com
My regex definitely matches all words, but I only need to keep the first two matches ((Doe John) (Doo Scooby)
There is only ever one line of text. The names are always in the same positions (lastname :after CN= until ) (firstname : next word after [space] until ,)
Any help would be great, and any material to look up why my regex isn't appropriate but why the suggested solution is would be greatly beneficial! I'm trying to get more useful information into our SIEM.