Well, my lesson for today is how to use a simple regular expression to validate usernames in Novell Identity Manager (DirXML).
Using the Novell Designer tool I created a policy that reads:
Condition: operation attribute
Name: CN
Operator: equal
Mode: regular expression
Value: ^[0-9]{10}
What this rule does is checks the CN attribute to ensure it is numeric of 10 characters.
Here's the XML source:
<if-op-attr mode=\"regex\" name=\"CN\" op=\"equal\">^[0-9]{10}</if-op-attr>
What bothers me is that in Designer it changes the 'equal' display to 'match' which made no sense to me as there is no match operator.
I also must say as painful as some people may say regex is, I find it very useful for things like this.
No comments:
Post a Comment