Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

LDAP mappings- regular expressions

we currently have a regular expression that checks an LDAP value. If it is 1,3,5 it returns ACTIVE, anything else INACTIVE. That expressions is:

expr:#DOMStatusCode#=([135])?(ACTIVE):INACTIVE

We have a new requirement to check for 0, if it is 0, then we want REVIEWED.  I've tried various interations to no avail. Does anyone have an idea on this? I

Everyone's tags (1)
2 REPLIES
New Member

LDAP mappings- regular expressions

Hi Patti,

Use this:

expr:#StatusCode#=([135]|0)?(ACTIVE|REVIEWED):INACTIVE

Since this is a different pattern, using the or operand (|) in both the if and then expressions the regular expression is similar to this pseudocode:

if (StatusCode eq 1 or 3 or 5) {
  assign ACTIVE as the value
} else if (StatusCode eq 0) {
  assign REVIEWED as the value
} else {
  assign INACTIVE as the value
}

New Member

LDAP mappings- regular expressions

Thanks!!! I just tried this out and it worked!  I didn't know the "OR" operator could be used in this fashion. It's a nice simple solution. I had been googling for 1.5 days and nothing like this came up. Thanks for taking the time to respond to my inquiry.

200
Views
0
Helpful
2
Replies
CreatePlease login to create content