in reply to Newbie Regex Problem
You can slice off the "LDAP://CN=" since you know it'll always be there, then you slice to the first comma.$test="LDAP://CN=MyPc,OU=MyOu,DC=NyDomain,DC=com"; $CN = substr($test, 10, index($test, ",") - 10); print "$CN\n";
|
|---|