I have the following string:
cn=abcd,cn=groups,dc=domain,dc=com
Can a regular expression be used here to extract the string after the first cn= and before the first ,? In the example above the answer should be abcd.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
most languages will extract the match as $1 or matches[1]
If you can’t for some reason wield subscripts,
Thats a way to do it in 2 steps.
If you were parsing it out of a log with sed
will get you what you want. ( Extra commands added to only print matching lines )