Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3962134
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:03:35+00:00 2026-05-20T03:03:35+00:00

This one is killing me,i’m a total noob with regex. Im trying to make

  • 0

This one is killing me,i’m a total noob with regex.
Im trying to make a site search and compare the entered text with the titles column in the
database.
Basically what i want to accomplish with regex is LIKE ‘%word1 word2 word3%’ , but with some string variatons.

For example :

SELECT * FROM table WHERE title REGEXP
‘w[ao]rd’

works just fine. It looks for word and ward. But when i want multiple words it returns nothing.

SELECT * FROM table WHERE title REGEXP
‘w[ao]rd sec[or]nd th[io]rd’

I don’t want to search for word OR second OR third i want to have them all in the title,just like in the upper case with LIKE.

I was thinking maybe to explode the search string the user inputs then in a foreach do a regexp word by word,but don’t know how to concatenate all of the variations into one query.

EDIT:
I forgot to mention that im searching in a utf8_unicode_ci collated table.
So really im trying to do a [cčć]orak type of search.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:03:36+00:00Added an answer on May 20, 2026 at 3:03 am
       SELECT * FROM table WHERE title REGEXP 'w[ao]rd|sec[or]nd|th[io]rd'
    

    edit:

    “okay so you want them to all be in the title and in that order?”

       SELECT * FROM table WHERE title REGEXP 'w[ao]rd.*sec[or]nd.*th[io]rd'
    

    This will look for those words (and the variations) and make them be in that order, so for example

    word blahblah second more blah third
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This one is killing me. I'm trying to make a simple console app that
This one is killing me! In ASP Classic I'm trying to stream users a
This one is a real head scratcher for me... var matches = Regex.Matches(<p>test something<script
I'm tearing my hair off my head on this one. Trying to parse this
This one is killing me. I have a fairly complicated JavaScript routine fired by
This one is killing me... I'm learning to develop SOAP servers in PHP at
Ok guys, this one is literally killing my mind, as I've been able to
This one is killing me: echo preg_match(/([a-zA-Z0-9\-\.]+)\.([a-zA-Z0-9]+)/,'downcom'); This one print 0 , because it
I've been killing myself all day for this one bug. I can't tell you
Folks, this one is killing me.... I'm using jscrollpane in a lot of places

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.