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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:39:54+00:00 2026-05-21T08:39:54+00:00

I have the following: Text: field id=25 ordinal=15 value=& $01234567890-$2000- Regular Expression: (?<=value=).*(?=) Replacement

  • 0

I have the following:

Text:

field id=”25″ ordinal=”15″ value=”& $01234567890-$2000-“

Regular Expression:

(?<=value=”).*(?=”)

Replacement String:

& $09876543210-$2000-


When I run Regex Replace in Expresso – it crashes the application.

If I run Regex.Replace in C#, I receive the following Exception:

ArgumentException

parsing “& $01234567890-$2000-” – Capture group numbers must be less than or equal to Int32.MaxValue.

  • 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-21T08:39:55+00:00Added an answer on May 21, 2026 at 8:39 am

    A $N in the replacement pattern refers to the Nth capture group, so the regex engine thinks you want to refer to capture group number “09876543210” and throws the ArgumentException. If you want to use a literal $ symbol in the replacement string then double it up to escape the symbol: & $$09876543210-$$2000-

    string input = @"field id=""25"" ordinal=""15"" value=""& $01234567890-$2000-""";
    string pattern = @"(?<=value="").*(?="")";
    string replacement = "& $$09876543210-$$2000-";
    string result = Regex.Replace(input, pattern, replacement);
    

    Also, your pattern is currently greedy and may match more than intended. To make it non-greedy use .*? so it doesn’t end up matching beyond another double quote later in the string, or [^"]* so that it matches everything except a double quote. The updated pattern would be: @"(?<=value="").*?(?="")" or @"(?<=value="")[^""]*(?="")". If you never expect the value attribute to be empty I suggest using + instead of * in any of the patterns to ensure it matches at least one character.

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

Sidebar

Related Questions

I have some text area field in my grails application. I got the following
I have the following code in the OnChange() event for a field. alert(alert text);
I have a hidden text field whose value gets updated via an AJAX response.
I have the following update panel with a text field limited to 9 characters
I have the following validation code for a text field but the 'field' below
when I want to remove div element, I have the following code: <div class='text-field'>
I have following text in SQLITE database in TEXT field The exact date of
(using netbeans and java) I have the following 1 text field named input 1
We have the following snippet to get focus on a particular text field in
I have the following HTML code: <td> <input type=text size=40 value= name=related_image id=related_image> <input

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.