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.
You should try:
Update: Try this one: