0

Let's say my LDAP has a multivalue-attribute foo. Foo contains one or more strings, each ending with a 2 digit number, from 01 to 99:

dn: object1
foo: text$01  
foo: text$02
foo: text$03

dn: object2
foo: text$03

To exclude all objects where foo contains a value ending with *03, the filter will look like:

(!(foo=*03))

Which will give 0 results with the example above. My problem is a little bit harder. I want all objects where foo=*03 is not the only value.
So if foo contains text$03 and any additional value, i want to get this object in my results. In this example the result should be object1.
I tried something like:

(& (foo=*) (!(foo=*03)) )

but as I expected, the second part will hide any object where foo contains *03.

So i ask, is there any way to solve this in LDAP only?

And please excuse my english, it's not my native language :(

Dennis
  • 1
  • 2
  • Can you do something like `(or (foo=*[012456789]) (foo=*[123456789]?) )` ? That is intended to mean keep anything whose last digit is not `3` or whose next-to-last digit is not `0`. – AdrianHHH Nov 28 '13 at 15:20
  • 2
    No. LDAP substring searches are NOT regex or wildcard, they are substrings. See RFC4515 for string representation of search filters. – Terry Gardner Nov 28 '13 at 15:40

0 Answers0