Re: Parse x.500 DN and change order displayed
- From: SecureIT <gotsecure@xxxxxxxxx>
- Date: Mon, 31 Mar 2008 09:20:48 -0700 (PDT)
On Mar 31, 8:26 am, Hallvard B Furuseth <h.b.furus...@xxxxxxxxxxx>
wrote:
SecureIT writes:
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"
Without escape sequences like "\," and "\+" in the DNs (if that's
allowed anyway, I don't remember the details of X.500 Dn syntax), this
moves serialNumber first in each RDN:
s/(^|,)([^,]*)\+(serialNumber=[^+,]*)(?=[+,])/$1$3+$2/gi;
die "didn't catch all 'foo+serialNumber's" if /\+serialNumber=/i;
--
Hallvard
That worked great, thanks so much. Just ran it and all 2000 DN's are
properly formatted now.
-G
.
- References:
- Parse x.500 DN and change order displayed
- From: SecureIT
- Re: Parse x.500 DN and change order displayed
- From: Hallvard B Furuseth
- Parse x.500 DN and change order displayed
- Prev by Date: FAQ 8.6 How do I check whether input is ready on the keyboard?
- Next by Date: Re: Parse x.500 DN and change order displayed
- Previous by thread: Re: Parse x.500 DN and change order displayed
- Next by thread: Re: Parse x.500 DN and change order displayed
- Index(es):