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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:24:34+00:00 2026-05-29T21:24:34+00:00

I am developing a windows application using c#. I am loading a file (html,

  • 0

I am developing a windows application using c#. I am loading a file (html, txt, xhtml) to the text box. I want to test the occurrence of following cases in my text box.

,(comma) with closeup text (ex. text1,text2)
.(dot) with closeup text (ex. text1.text2)
:(colon) with closeup text (ex. text1:text2)
,(comma) with closeup ' i.e (left single quotation mark)
"(doublequote) with closeup text
'(single quote) with closeup text
</i> with closeup text (ex. </i>text)
</span> with closeup text.

For all the occurrences of the above condition I want to highlight the particular found text in the textbox. I am trying to use the regular expression. I am inserting all the cases in the array list and checking one by one. For the first case if the text in the textbox is like hjhdf, dfsjf then it will show the message box, if any text before and after this particular text then it will not show the messagebox.

string regexerror = wordToFind;
Regex myregex = new Regex("^[,]*[a-zA-Z]*$");
bool isexist = myregex.IsMatch(rtbFileDisplay.Text);
if (isexist)
{
    MessageBox.Show("Hi");
}
  • 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-29T21:24:36+00:00Added an answer on May 29, 2026 at 9:24 pm

    At the moment you’re only matching the beginning of the entire text with ^. You need to get it to match the beginning of a line instead.

    Look at this link: http://msdn.microsoft.com/en-us/library/yd1hzczs.aspx. This explains use of the MultiLine property:

    myregex.MultLine=true;
    

    This should do the job.

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

Sidebar

Related Questions

I am developing a JSF web application on a Windows box using Emacs as
I am developing a windows application using vb.net, I have a simple html page
im developing windows application using c#. i want to close the application and show
I'm developing a Windows application in VS2005 using C#. In my project, I generate
I am developing an application using Windows Mobile 5.0, under embedded VC++ 4.0, and
I developing ASP.NET application using a Swedish version of Windows XP and Visual studio
I'm developing an application for Windows Mobile Devices using Visual Studio .NET 2008 whose
I'm developing an winform application for Windows Mobile 5.0 and above. I'm using .Net
I am developing a WPF application that must run using Windows Classic theme. The
I am developing a simple ASP.Net application on a Windows 7 x64 machine using

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.