I’m still pretty new to perl and regex and need some help getting started. I would love to provide some code, but that’s kinda where I’m stuck.
What I’m trying to do is that I have this string in a file like this:
dn: CN=doe\, john,OU=Users,DC=domain,DC=com
and a string like this:
uid: d12345
I need to do a search and replace to get the following result.
dn: uid= d12345,OU=Users,DC=domain,DC=com
Can anyone help me get started with this one? Much thanks!
So you want to replace
CN=doe\, johnwithuid= d12345? Try this:That will replace everything from
CN=to the first unescaped comma with the uid.