my $string = "huckabee AND jfkadlsfj fdsfldfj06329 OR reagan AND bide +n AND clinton OR sebelius OR mccain"; my @chunks = split / AND /, $string; @chunks = map { /OR/ ? "($_)" : $_ } @chunks; print join(' AND ', @chunks), "\n"; __END__ huckabee AND (jfkadlsfj fdsfldfj06329 OR reagan) AND biden AND (clint +on OR sebelius OR mccain)
In reply to Re: Building a boolean search engine
by moritz
in thread Building a boolean search engine
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |