[Date Prev][Date Next] [Chronological] [Thread] [Top]

escaping '*' in search strings (ITS#275)



A problem with escaping string for regex?  The search string '\*'
doesn't always get interpreted as matching the literal char '*'.

ldapadd -p $LDAP_PORT -D "$LDAP_BIND" -w $LDAP_PASS << EOF
dn: cn=noel-star, $LDAP_BASE
star: a*b
EOF

(these work ok)
ldapsearch -p $LDAP_PORT 'star=*'
ldapsearch -p $LDAP_PORT 'star=a*b'

(these return matches, but they shouldn't)
ldapsearch -p $LDAP_PORT 'star=a\*'
ldapsearch -p $LDAP_PORT 'star=\*b'

(this doesn't return a match, but it should)
ldapsearch -p $LDAP_PORT 'star=*\**'

--Noel