I’m doing a lookup from LDAP where I need to search based on a pager number. Our pager numbers could have hyphens or spaces or parens in them. I’m trying to figure out the search filter I need on my pager field, assuming that my user may or may not know where the parens or hyphens are in the LDAP field.
I am trying to write a filter that will match the last five numeric digits.
Example(the single quotes aren’t stored in LDAP, I’m using them here as delimiters):
'127 13098'
'125 or (44)8-9622'
'126 (12349)'
These would all be possible values in our Pager field in LDAP.
Here’s what I have so far:
(&(objectCategory=person)(objectclass=user)(sn=*)(givenname=*)(pager=*” + Pager.Trim() + “))”
This works fine for the first example, but it won’t get the middle example, if the user enters just the numeric digits.
Is it going to be possible to write a filter that will find the five digit combination for all three cases, or am I going to need to do multiple searches?
I’m not quite sure I follow the values, but, you can OR a filter together:
(&(objectCategory=person)(objectClass=user)(|(pager=*127 13098*)(pager=125)(pager=126)...))The sn and givenName filters shouldn’t be necessary unless that’s filtering some specific data out. I’d make sure your pager attribute is indexed and has a tuple index in AD.