There are a few ways to do this, none of them very
attractive. One is
to capture all the matches, then go through them
programmatically.
Another is to use lookaround:
^(?=.*?country).*?usa
Does MySQL even support variable-length lookaround? Since
"usa" can
come before *or* after "country," this expression
gets rather verbose.
But if you're writing SQL, why not just AND the two RLIKE
expressions?
On Jan 16, 10:05 am, "Extremest" <a... binindex.net> wrote:
> I am using mysql and have found that rlike is faster
95% of the time
> over fulltext search and more exact. My question is -
Is there a way
> to have the regex match only if 2 or more words are
found. I know that
> 'country|usa' would have it find either one. I want to
know is there a
> way to have it match only if both are present or do I
need to use 2
> different rlike regex's in the where clause.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regex googlegroups.com
To unsubscribe from this group, send email to
regex-unsubscribe googlegroups.com
For more options, visit this group at http://grou
ps-beta.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---
|