Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > RE: parse x.500...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 10830 of 11989
Post > Topic >>

RE: parse x.500 DN and change order displayed

by t.baetzler@[EMAIL PROTECTED] (T Baetzler) Mar 31, 2008 at 02:25 PM

Peter Scott <Peter@[EMAIL PROTECTED]
> wrote:

> On Sun, 30 Mar 2008 20:36:58 -0700, SecureIT wrote:
> > I am trying to change this
> >=20
> > "cn=3DBob Smith+serialNumber=3DCR013120080827,o=3DICM,c=3DUS"
> >=20
> > to this:
> >=20
> > "serialNumber=3DCR013120080827+cn=3DBob Smith,o=3DICM,c=3DUS"
=20
>    s/^(cn=3D.*?)+(.*?),/$2+$1,/;

Close, but no cigar ;-)

+ is a quantifier meaning 1 or more matches of the
preceeding expression, so you'll end up with all of
the string up to , in $1 and nothing in $2.

You'll have to escape it to match a literal '+'.

I would also drop the ^ since it is unclear if the
data is indeed without leading whitespace and/or
quotes.

HTH,
Thomas
 




 2 Posts in Topic:
RE: parse x.500 DN and change order displayed
t.baetzler@[EMAIL PROTECT  2008-03-31 14:25:11 
RE: parse x.500 DN and change order displayed
peter@[EMAIL PROTECTED]   2008-03-31 05:34:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 10:30:59 CDT 2008.