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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:46:31+00:00 2026-05-23T16:46:31+00:00

Microsoft offers a method called Match that matches a Regex pattern starting at a

  • 0

Microsoft offers a method called Match that matches a Regex pattern starting at a specific position in the input string. What I am trying to do is optimize the performance of my program by using the static method version of Match, there by gaining the benefit of caching. There does not seem to be a way to specify a specific position to start matching though, even though the member version does. Is there anyway to emulate this or is there an alternate static method I’m missing that allows me to start searching for my pattern at a specific spot in the input string? Any help would be appreciated.

  • 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-23T16:46:32+00:00Added an answer on May 23, 2026 at 4:46 pm

    If you use a disassembler tool like DotPeek to look inside the System.dll, you’ll see that the implementation of the static function creates a new Regex object:

    public static Match Match(string input, string pattern)
    {
      return new Regex(pattern, RegexOptions.None, true).Match(input);
    }
    
    public static Match Match(string input, string pattern, RegexOptions options)
    {
      return new Regex(pattern, options, true).Match(input);
    }
    

    So in fact it’s just the opposite – the static function has worse (or at least not better) performance.

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

Sidebar

Related Questions

I'm frustrated recently by all of the choices that Microsoft offers to develop a
I am developing a web app using silverlight. I read that Microsoft offers 10
I've just stumbled on a Microsoft program that offers Visual Studio Professional, among other
Microsoft recently announced that the Javascript/HTML DOM library jQuery will be integrated into the
Microsoft recently announced that they were endorsing jQuery as an officially supported JavaScript library.
Okay, so I'm writing a utility that compares 2 XML documents using Microsoft's XML
Microsoft offers a bunch of incentives for developers (like MSDN) and startups (like BizSpark)
Now that I've started learning Microsoft's languages and using Visual Studio, any time I
Microsoft offers the InterlockedCompareExchange function for performing atomic compare-and-swap operations. There is also an
Sometimes Microsoft does something so stunningly dumb that it makes my head hurt. Help

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.