\1 – it means the first capturing group in the matched expression.
\n would be the nth capturing group. (Note that
\0 would be whole match). In many engines, the upperlimit for n is 9, but some support up to 99 as well.
When used in regex like
(a|b)\1, it means that after a or b, the next character should be the first captured group, which is a or b so the regex here would match
- How to validate phone numbers using regex
- How do I match any character across multiple lines in a regular expression?
- Regular expression to match DNS hostname or IP Address?
- Match two strings in one line with grep
- Symbol for any number of any characters in regex?
- Regular expression for floating point numbers
- Remove empty lines in text using Visual Studio or VS Code
- Validating IPv4 addresses with regexp
- Regular expression to match a word or its prefix
- Regular expression for a string containing one word but not another
- Regex matching in a Bash if statement
- How to search for occurrences of more than one space between words in a line
- Extract substring using regexp in plain bash
- How do I use regex in a SQLite query?
- Regular expression to match EOF
- Regex optional group
- grepping using the “|” alternative operator
- Regex any ASCII character
- Wildcards in the pattern for http.HandleFunc
- What are PCRE limits?
- Replace newlines with literal \n
- Regex for route matching in Express
- Pattern matching digits does not work in egrep?
- Search in VS Code for multiple terms
- Regular expression: zero or more occurrences of optional character /
- Replace all whitespace with a line break/paragraph mark to make a word list
- Bash, grep between two lines with specified string
- Can’t escape the backslash in a regular expression?
- How to replace a string in an existing file in Perl
- Guide on how to use regex in Nginx location block section?
- Regular Expression only match if String ends with target
- Negate characters in Regular Expression [closed]
- How to create a regex that will match an arbitrary sequence of spaces and tabs
- Why does VIM have its own regex syntax?
- How to extract domain name from url?
- Emacs: regular expression replacing to change case
- Kibana query exact match
- Regex to match only uppercase “words” with some exceptions
- What to do when a regular expression pattern doesn’t match anywhere in a string?
- Regular Expression Lookbehind doesn’t work with quantifiers (‘+’ or ‘*’)
- Support of \K in regex
- How can I match spaces with a regexp in Bash?
- Regex matching beginning AND end strings
- Reference – What does this regex mean?
- Regular expression to allow for number values between 1-3 digits?
- Grep Regex: List all lines except
- Invert match with regexp [duplicate]
- Split string and get last element
- How can I match query string variables with mod_rewrite?
- Vim search for a pattern and if occurs delete to end of line