javascriptregexldapdn

javascript regular expression for DN


I wan a regex to alidate all types of possible DN's

I create one but its not so good.

/([A-z0-9=]{1}[A-z0-9]{1})*[,??]/ and some others by changing it, but in vain.

Posible DN's can be

CN=abcd,CN=abcd,O=abcd,C=us
CN=abcd0520,CN=users,O=abcd,C=us
C=us

etc

Solution

  • I created one. Working great.

    ^(\w+[=]{1}\w+)([,{1}]\w+[=]{1}\w+)*$