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 6384369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:46:03+00:00 2026-05-25T02:46:03+00:00

I want to search this string: This is, mybigstring And search words could be:

  • 0

I want to search this string:
“This is, mybigstring”

And search words could be:
“is, big, mybigstring”

At the moment I’m using stristr which will find matches for all these words. However I do not want “big” to match.. Meaning that I won’t allow substrings. How can I do this?

Update:
I tried this out after reading your answers:

$testregxp = "\b(copenhagen|kobenhavn)\b";
$test = "Copenhagen, Denmark";
print preg_match($testregxp, strtolower($test));

But I can’t seem to get it working..

  • 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-25T02:46:04+00:00Added an answer on May 25, 2026 at 2:46 am

    You could use a regular expression for this. Depends if you want to find all instances of the word.

    http://php.net/manual/en/function.preg-match.php

    or

    http://www.php.net/manual/en/function.preg-match-all.php to find all instances instead of just 1 match.

    Also if you want to search all of them at the same time you can do that as well.

    Something like

    \bis\b should work. this should search for the actual word “is”, so tis would not match, but your case “is,” will even with that comma there.

    to search for any of them at the same time you can do

    \b(is|This|big)\b this will match is and This, but big won’t be found.


    Update

    I’m not exactly sure what you want 100%, but you can just add the comma. IE: "/\b(copenhagen|kobenhavn)\b,/i" now if you want to include the comma in the search you can do, "/\b(copenhagen|kobenhavn)\b,?/i", so the comma is optional. If you did

    \b(copenhagen|kobenhavn|denmark)\b,?

    on

    “Copenhagen, Denmark”

    it will match

    Copenhagen,

    and

    Denmark

    Note the comma in Copenhagen, but the comma is optional in this case. So it will match the word with or without it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got this Excel Workbook which I want to search for a specific string
For example, I want to search a word ' marple ', this should return
I want something like this: abcdab.search(/a/g) //return [0,4] Is it possible?
I got this url /search/renttype-all.place-all.type-all.bedrooms-all.0.0/ I want to get the text after the second
I want to search a directory of files to find all cases where the
I want to search a table to find all rows where one particular field
I want to search the program >> that is by which you append to
I have this String: foo bar 567 baz Now I want to add before
I want to search for a string in a large gz file and also
I'm Trying to get a php string to break down into individual words, search

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.