Hello all.

I've learned a bit about regular expressions today. I have a string formatted
like "CN=foo,OU=bar,O=pah" and I need to parse out "foo". I have created the
following code which does work:

$dnvalue =~ m/([^,]*)/;
$username = $1;
$username =~ s/(CN=)//;
print $username

However, I'd like to do the match/replace on a single line. Can anyone show me
how to combine these statements into a more elegant regular expression?

Thanks,
Mike

Reply via email to