Sorry about the ambiguous title, as I couldn't think of how to articulate the question.
I have a CSV file that has hundreds of lines, with thousands of LDAP distinquished names. One of the sample lines could look like:
CN=John Doe,OU=Miami,DC=contoso,DC=com; CN=Spamela Anderson,OU=Los Angeles,DC=contoso,DC=com; CN=Cosmo Kramer,OU=Subfolder,OU=Subfolder,OU=ParentFolder,DC=FABRIKAM,DC=com; CN=Bob Barker,DC=contoso,DC=com
CN=Luke Skywalker,OU=Tattoine,DC=contoso,DC=com; CN=Brad Pitt,OU=Hollywood,DC=contoso,DC=com; CN=Mickey Mouse,OU=Users,DC=contoso,DC=com
CN=Ted Nugent,OU=Houston,DC=FABRIKAM,DC=com; CN=Carl Sagan,DC=Uranus,DC=contoso,DC=com
I'd like to remove any distinguished name that is in the FABRIKAM.COM domain (dc=fabrikam,dc=com). In the sample, I'd like to strip out:
;CN=Cosmo Kramer,OU=Subfolder,OU=Subfolder,OU=ParentFolder,DC=FABRIKAM,DC=com
I've tried to use:
CN=(.*)?,DC=fabrikam,DC=com
But this finds the first occurrence of "CN=" from the beginning of the line until an occurrence of "DC=fabrikam,dc=com" (which would also include John Doe and Spamela Anderson, in my sample).
Is there a way to find the first occurrence of "CN=" to the left of "DC=fabrikam,DC=com" as the boundary?
(I use either Notepad++ or Programmer's Notepad)