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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:05:50+00:00 2026-06-06T22:05:50+00:00

I can never seem to find any documentation on the regex for matching a

  • 0

I can never seem to find any documentation on the regex for matching a capture group as part of the pattern. For example:

(\w\d\w):$1

..should match a4b:a4b

$1 doesn’t work, but I know it’s something similar. Anyone know?

  • 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-06T22:05:51+00:00Added an answer on June 6, 2026 at 10:05 pm

    In a regex pattern, a backreference to the first capturing group is always \1, not $1.

    Reason: $ means “end of string” (or end of line, depending on context) in a regex.

    In a replace pattern (which isn’t a regex), some dialects allow $1 (e. g. .NET, Java, Perl and JavaScript), some allow \1 (Python and Ruby), and some allow both (PHP and JGSoft).

    Edit: Since you wrote that you couldn’t find any documentation on this, check out these overviews on regular-expressions.info:

    • Grouping and Backreferences
    • Regex Replacement Syntax
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've never been good with regex and I can't seem to get this... I
If been looking around the web and can't seem to find any good solutions
I'm going through Bitbucket and I can't seem to find any Mercurial repositories that
I can't seem to find how to add simple validations to a form. I
I have a head aching problem that I can't seem to find an easy
I can't seem to find what the current syntax for using java classes in
I can't find any way to draw a force directed graph where the weighting
Switching to GitHub and can't seem to find information on how to do something
I can never find the source code of the F# core libraries. I know
Sometimes, I'll end up having to catch an exception that I know can never

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.