RE: parse x.500 DN and change order displayed
- From: peter@xxxxxxxx
- Date: Mon, 31 Mar 2008 05:34:24 -0700 (PDT)
Peter Scott <Peter@xxxxxxxx> wrote:
On Sun, 30 Mar 2008 20:36:58 -0700, SecureIT wrote:
I am trying to change this
"cn=Bob Smith+serialNumber=CR013120080827,o=ICM,c=US"
to this:
"serialNumber=CR013120080827+cn=Bob Smith,o=ICM,c=US"
s/^(cn=.*?)+(.*?),/$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.
Sigh. Too little sleep.
/^(cn=.*?)\+(.*?),/$2+$1,/;
I would also drop the ^ since it is unclear if the
data is indeed without leading whitespace and/or
quotes.
If it's really a DN as the subject states, both will be true.
.
- References:
- RE: parse x.500 DN and change order displayed
- From: T Baetzler
- RE: parse x.500 DN and change order displayed
- Prev by Date: RE: parse x.500 DN and change order displayed
- Next by Date: Re: algorithm/permute.pm
- Previous by thread: RE: parse x.500 DN and change order displayed
- Next by thread: perl byte code generation
- Index(es):