Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Newbie Regex Problem

by omouse (Initiate)
on Oct 20, 2007 at 15:28 UTC ( [id://646182]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://646182]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-03-29 10:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found