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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:04:10+00:00 2026-05-30T04:04:10+00:00

How to search a word in exact match, for example how to search word

  • 0

How to search a word in exact match, for example how to search word ‘leak‘, but search results should not include words like ‘leaked‘ or ‘leaks‘ etc.

Help in both Javascript and MySQL would be appreciated.

  • 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-30T04:04:11+00:00Added an answer on May 30, 2026 at 4:04 am

    Basically, you need to look for word boundaries. So don’t think of looking for the word leak, but looking for the word $leak#, where $ is an imaginary character that is at the beginning of every word and # is an imaginary character at the end of every word (Not a standard convention, just assume it for this example). The words are delimited, by, lets say whitespaces for now. So, leaked and leaks is $leaked# and $leaks#. As such, the only part that matches is $leak and not $leak#.

    To do that in MySQL, the condition would be:

    REGEXP '[[:<:]]leak[[:>:]]';
    

    Here, [[:<:]] is the begin-word word-boundary and [[:>:]] is the end-word word-boundary.

    For JavaScript, the query would be:

    /\bleak\b/
    

    Here, the sequence \b represents a word-boundary (in javascript, there is no distinction between begin-word and end-word boundaries). It won’t only work for whitespaces, but even punctuation characters, for example:

    .leak
    ,leak
    ;leak
    

    will match /\bleak\b/, but aleak will not. (I am unsure about MySQL though)

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

Sidebar

Related Questions

Possible Duplicate: MySQL - How to search for exact word match using LIKE? For
I'm trying to create a word search game (kind of like Wordament but much
For example, I want to search a word ' marple ', this should return
I've been using word boundaries to look up exact words in a string but
I need to search a word exact same character or similar character not in
This is quite weird but my search function can search for any word except
I am trying to achieve fuzzy phrase search (to match misspelled words) by using
I'm just not sure what the exact way to word it is.. This tells
I'm trying to search through a Word document and replace a specific string (Using
I'm trying to search for a word/phrase within all the php files and all

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.