in reply to Newbie Regex Problem

If $test isn't part of a larger string, you can just slice it instead of using a regular expression.
$test="LDAP://CN=MyPc,OU=MyOu,DC=NyDomain,DC=com"; $CN = substr($test, 10, index($test, ",") - 10); print "$CN\n";
You can slice off the "LDAP://CN=" since you know it'll always be there, then you slice to the first comma.