# Net-ldap-0.1.1 gives invalid filter syntax cuz of parenthesi

**URL:** <https://www.ruby-forum.com/t/net-ldap-0-1-1-gives-invalid-filter-syntax-cuz-of-parenthesi/194401>\
**Category:** Rails\
**Created:** [September 3, 2010, 8:55pm UTC](https://www.ruby-forum.com/t/net-ldap-0-1-1-gives-invalid-filter-syntax-cuz-of-parenthesi/194401 "2010-09-03T20:55:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cuzic4n](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/cc9497/32.png) [@cuzic4n](https://www.ruby-forum.com/u/cuzic4n)\
**Post date:** [September 3, 2010, 8:55pm UTC](https://www.ruby-forum.com/t/net-ldap-0-1-1-gives-invalid-filter-syntax-cuz-of-parenthesi/194401/1 "2010-09-03T20:55:27Z")

</div>

Things like this won’t work… they fail with Invalid filter syntax  
filter = Net::LDAP::Filter.construct(“nisnetgrouptriple=(,user,)”)  
If I remove the parenthesis and it works fine.

or if you use  
filter = Net::LDAP::Filter.eq( “nisnetgrouptriple”, “(,user,)” )  
then that works fine…

but i want to have compound statements and take them from a web front  
end so this is all tedious to construct.

This will fail with invalid filter syntax as well:  
filter =  
Net::LDAP::Filter.construct("(&(objectClass=Person)(|(sn=Jensen)(cn=Babs  
J\*)))")

Anyone found better work arounds for things like this other than going  
to ruby/ldap c based gem?
