I have the following string:
EN=sdfsdf, CN=User Name, CN=Users, DC=domain, DC=co, DC=il
I need to return the first string that starts with "CN=" and ends with an ",". In this case I need to return "User Name".
'CN=.*,' returns "CN=User Name, CN=Users, DC=domain, DC=co,"
How can I get the just the first occurrence?