In asterisk we get the following string from the AD:
"CN=lastname firstname,OU=internal,OU=UserAccounts,OU=bussiness,DC=bussiness,DC=bussiness,DC=be"
I only need "lastname firstname" so I would like to use REGEX to cut away:
- everything before and including the "="
- everything behind and including the first ","
Is this possible?
Kind regards,
CodePudding user response:
You can use this Regex:
(?<=CN=)[^,]
You can replace CN
by any field to get its value.
Try it here