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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:55:12+00:00 2026-05-20T16:55:12+00:00

this might be a frequent question but my case is: assuming my keyword is

  • 0

this might be a frequent question but my case is:

assuming
my keyword is “black pepper”
and my plain text is a recipe that contains the word “peppercorns”

i would like to be bale to highlight the word peppercorns, not just pepper (eventhough this latter could be a good achievemet as well)

is it possible in php using preg_match? shoudl i split the keyword and craeate mutliple comparisons?

thanks

  • 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-20T16:55:13+00:00Added an answer on May 20, 2026 at 4:55 pm

    The question is slighly unclear. You want to highlight everything that is connected to black pepper? In the case of peppercorns that’s easy because it’s in one word together with pepper. But what if the text contains ‘blackbirds’, would you then highlight this word as well?

    What you’re trying to do needs intelligence or at least a complex lexical approach, you can’t solve it with an algorithm.

    If your keyword is only pepper, it becomes much easier, but only if pepper has only one meaning. In that case you could highlight everything that has pepper in it. But you would miss terms using more than one word. Here you would need a lexical approach again. If your engine knows that black pepper and white pepper are sub-patterns of pepper, then it works.

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

Sidebar

Related Questions

This might be a general mvp places and activities question, but the show case
This might seem like a very easy question for some of you folks, but
This might be a simple question but I've searched and searched and can't find
This might be a very basic question but it confuses me. Can two different
This might sound like a stupid question but just trying to learn something here.
Frequent visitor but first post here on StackOverflow, I'm hoping that you guys might
This might be a stupid question, but although I have a few projects now
This might be an easy question, but I cannot figure out why the compiler
This might seem like a basic question and back to Http protocol 101. But
This might be a pretty straightforward question, but I'm trying to understand some of

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.