|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
On 2 Oct, 15:22, validus <valid...@gmail.com> wrote:
> Sorry. Didn't realize it wasn't clear at the beginning and was trying > to be as brief as possible. > Thanks for the suggestions using LIKE. I was aware of those but was > wondering if there was > a REGEXP solution that might be cleaner/faster. Of course there may > not be one. > > cheers > > > > > Would have saved a lot of time if you'd explained this or used more > > deswcriptive examples at the start! > > > In the absence of FULLTEXT, how about: > > > SELECT > > id, > > desc > > FROM db > > WHERE desc LIKE '%red%' AND desc LIKE '%white%' AND desc LIKE '%blue%'- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - Well, I'm not sure if MySQL supports this part of the regex spec, but this works for some implementations: (?=.*red)(?=.*white)(?=.*blue) or to find only complete words: (?=.*\bred\b)(?=.*\bwhite\b)(?=.*\bblue\b) |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
That is more along the lines of what I was trying to figure out. Not
sure if MySQL supports that yet but it is a good place to start. Thanks for the assist all. > Well, I'm not sure if MySQL supports this part of the regex spec, but > this works for some implementations: > > (?=.*red)(?=.*white)(?=.*blue) > > or to find only complete words: > > (?=.*\bred\b)(?=.*\bwhite\b)(?=.*\bblue\b)- Hide quoted text - > > - Show quoted text - |
|
![]() |
| Outils de la discussion | |
|
|