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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:21:12+00:00 2026-06-13T09:21:12+00:00

I am developing an ASP.NET application in which I have to display description for

  • 0

I am developing an ASP.NET application in which I have to display description for text documents after performing SQL full text search query. I have to highlight the user input search string with in description of that document. Now problem is that:

If the user enters rang as input search string then I have to check whether that string is part of another word or appears as an individual word. For example:

1 – rang may appear by itself or it may be part of some word i.e. W*rang*ling.

2 – weep may appear by itself or it may be part of *weep*ing.

How can I validate such condition for strings? Is it possible through Regex.Match()?
Any help will be much appreciated.

NOTE: A single word may appear multiple times in multiple ways within a paragraph.

  • 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-13T09:21:13+00:00Added an answer on June 13, 2026 at 9:21 am

    You can do that in regex

    string word=Regex.Escape("rang");//your word..used regex.escape to escape regex characters if any
    
    Regex rx = new Regex("\b(.*?)"+word+"(.*?)\b", RegexOptions.IgnoreCase);
    
    foreach (Match m in rx.Matches(yourInputText))
    {
        if(m.Groups[1]!="" || m.Groups[2]!="")
        {
            //the word is between some words
        }
        else
        {
            //the word occurs separately
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing an ASP.net c# application. I have a grid view which
I'm developing an ASP.NET application which needs Windows Authentication. I have the web.config set
Hai I am developing an C# application(not asp.net) in which I have to get
I have a project (Web Application) which I have been developing in C#/ASP.NET, and
I am developing an asp.net web application. In which I have an image and
I am developing an ASP.NET MVC2 application in which I have a User class
I have just started developing a full-web application by using the ASP .NET MVC
I am developing an asp.net mvc application where user1 could delete data records which
I am developing an asp.net mvc application, which has these enity classes: public class
I am developing an ASP.Net VB Web Application The application contains a GridView which

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.