Re: Parse x.500 DN and change order displayed



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
.



Relevant Pages

  • Re: Parse x.500 DN and change order displayed
    ... allowed anyway, I don't remember the details of X.500 Dn syntax), this ... moves serialNumber first in each RDN: ... Using this regex will take care of \, ...
    (comp.lang.perl.misc)
  • Re: Parse x.500 DN and change order displayed
    ... this moves serialNumber first in each RDN: ... Using this regex will take care of \, ... nontrivial parsing like escape sequences, you have to be careful to ...
    (comp.lang.perl.misc)
  • Re: Parse x.500 DN and change order displayed
    ... moves serialNumber first in each RDN: ... Using this regex will take care of \, ... nontrivial parsing like escape sequences, you have to be careful to ...
    (comp.lang.perl.misc)