I am trying to match a pattern from and Active Directory extract. I have tried numerous things. In words what I want to match is "Anthing between the CN= and the following , " When I use the anything construct . I end up getting the entire text. Of course I can use exact patterns such as \w+\s\w+|\w+\s\w+-\w+
but obviously I wont know all of the possible combinations so I want to be able to match anything between the CN= and the following , and repeat this for the whole string. Following is an example string (names have been changed of course). Thanks in advance for any help!
"CN=Some group,CN=Users,DC=somecompany,DC=com","CN=John,OU=Service Accounts,DC=somecompany,DC=com;CN=Mickeymouse,OU=Service Accounts,DC=somecompany,DC=com;CN=Danny,OU=Service Accounts,DC=Somecompany,DC=com;CN=Sandra gather-brown,OU=Finance Accounting,OU=St Petersburg,DC=Somecompany,DC=com;CN=Jon t Smith,OU=NorthCarolina,DC=Somecompany,DC=com;CN=Jane Jones,OU=SouthCarolina,DC=Somecompany,DC=com;CN=Samantha Johnson,CN=Users,DC=Somecompany,DC=com;CN=Exch service,CN=Users,DC=Somecompany,DC=com;CN=huay-son-young,CN=Users,DC=Somecompany,DC=com;CN=Sam Johnson,CN=Users,DC=Somecompany,DC=com;CN=Sampson,CN=Users,DC=Somecompany,DC=com;
CN=David Blythe,CN=Users,DC=Somecompany,DC=com;CN=William Jones,CN=Users,DC=Somecompany,DC=com;CN=some-name-person-whatever,CN=Users,DC=Somecompany,DC=com;CN=Jim Smith,CN=Users,DC=Somecompany,DC=com"
but obviously I wont know all of the possible combinations so I want to be able to match anything between the CN= and the following , and repeat this for the whole string. Following is an example string (names have been changed of course). Thanks in advance for any help!
"CN=Some group,CN=Users,DC=somecompany,DC=com","CN=John,OU=Service Accounts,DC=somecompany,DC=com;CN=Mickeymouse,OU=Service Accounts,DC=somecompany,DC=com;CN=Danny,OU=Service Accounts,DC=Somecompany,DC=com;CN=Sandra gather-brown,OU=Finance Accounting,OU=St Petersburg,DC=Somecompany,DC=com;CN=Jon t Smith,OU=NorthCarolina,DC=Somecompany,DC=com;CN=Jane Jones,OU=SouthCarolina,DC=Somecompany,DC=com;CN=Samantha Johnson,CN=Users,DC=Somecompany,DC=com;CN=Exch service,CN=Users,DC=Somecompany,DC=com;CN=huay-son-young,CN=Users,DC=Somecompany,DC=com;CN=Sam Johnson,CN=Users,DC=Somecompany,DC=com;CN=Sampson,CN=Users,DC=Somecompany,DC=com;
CN=David Blythe,CN=Users,DC=Somecompany,DC=com;CN=William Jones,CN=Users,DC=Somecompany,DC=com;CN=some-name-person-whatever,CN=Users,DC=Somecompany,DC=com;CN=Jim Smith,CN=Users,DC=Somecompany,DC=com"