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

  • Home
  • SEARCH
  • 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 7565113
In Process

The Archive Base Latest Questions

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

i have a simple regex expression below to pull out the value within a

  • 0

i have a simple regex expression below to pull out the value within a string that is surrounded by end**end, example below. However, although it’s stupidly simple im struggling to get the results I need! Is there something obvious I’m missing!
Many thanks as always.

var str = "endhelloend";
var match = Regex.Match(str, @"end([a-z]+)end$", RegexOptions.IgnoreCase);

if(match.Success)
{
    result = match.Groups[0].Value  // should return 'hello'
}
  • 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-30T14:04:07+00:00Added an answer on May 30, 2026 at 2:04 pm

    Use solution 1 to extract .html text content and then filter your desired text from text by using solution 2.

    1. To clean html elements within .htm file, try this:

      string CleanXml(string DirtyXml)
      {
          //string clean = ""; 
          int startloc = 0, endloc = 0;
      
          for (int x = 0; x <= DirtyXml.Length-1; x++)
          {
              if (DirtyXml[x] == '<')
              {
                  startloc = x;
                  x++;
              }
              if (DirtyXml[x] == '>')
              {
                  endloc = x;
                  x++;
                  DirtyXml = DirtyXml.Remove(startloc, (endloc - startloc)+1);
                  x = 0;
              }   
          }
          return DirtyXml;
      }
      
    2. Regex to filter text “endhelloend” to obtain “hello”
      enter image description here

          string result = "";
          var str = "endhelloend";
          var match = Regex.Match(str, @"end([a-z]+)end$", RegexOptions.IgnoreCase);
          if(match.Success)
          {
              result = match.Groups[1].Value;  // Returns 'hello'
          }
          Console.WriteLine(result);
          Console.ReadLine();
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this simple regex, [\d]{1,5} that matches any integer between 0 and 99999.
Simple regex question. I have a string on the following format: this is a
Let's say I have two strings like this: XABY XBAY A simple regex that
i have simple regular expression: ^123$ Matches are for example 123 1234 etc. How
I used an online regular expression (regex) tester to build a simple regex, however
I have what seems a simple enough regex problem that I can't seem to
I have simple regex \.*\ for me its says select everything between and ,
I've been looking for a simple regex for URLs, does anybody have one handy
I have a simple question how do I remove a \ with regex? Thanks
I have a very simple CLR Function for doing Regex Matching public static SqlBoolean

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.