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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:20:34+00:00 2026-06-06T15:20:34+00:00

I am trying to match words driven from a database in a string input

  • 0

I am trying to match words driven from a database in a string input using VB .NET
The syntax I am using is so simple:

Regex.Matches(ArticleBody, "\b" & TagLabel & "\b", RegexOptions.IgnoreCase)

Where “TagLabel” is a variable from the database, and “ArticleBody” is the user input.
All is working fine, but I have a little issue:

Let’s suppose that:

TagLabel = "مصر"
ArticleBody = "لكن الجنرال المدني مصرٌ على الأمل، ولو كان حزيران يشي بالعكس."

Please note the “Tanwin” in “مصر” in the ArticleBody ” ٌ ” at the end of the fourth word.
The Regex function is matching the word “مصر”, while it should not.
I already searched for solutions, but didn’t find any.

Please advise.

  • 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-06-06T15:20:36+00:00Added an answer on June 6, 2026 at 3:20 pm

    You should try:

    Regex.Matches(ArticleBody, "\b" & TagLabel & "\b", 
      RegexOptions.IgnoreCase | RegexOptions.RightToLeft)
    

    Update: Try this one:

    Regex.Matches(ArticleBody, "(?<=(?:\s|^))" & TagLabel & "(?=(?:\s|$))", 
      RegexOptions.IgnoreCase | RegexOptions.RightToLeft)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to remove words from a string if they match a list.
I'm trying to match a set of hashtags or words in a javascript string.
I'm trying to make a regex that would match this string: asf, Algeria, Wilaya
How do I prevent javascript from replacing sections of words that match a string
I am trying to match two or more words in a string. The string
I am trying to achieve fuzzy phrase search (to match misspelled words) by using
I'm trying to write a Javascript regex that matches words with less than 3
I'm trying to match words on the page by using :contains, If i'm searching
I am trying to match words with up to two missing letters with regex.
I'm trying to get a regex that matches: (It should not match any other

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.