CINXE.COM

Backreferences To Failed Groups, Nested References, Forward References

<!DOCTYPE html> <html lang="en"><head><meta charset="utf-8"><link rel=canonical href='https://https://www.regular-expressions.info//backref2.html'><title>Backreferences To Failed Groups, Nested References, Forward References</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="author" content="Jan Goyvaerts"> <meta name="description" content="In a regular expression, parentheses can be used to group regex tokens together and for creating backreferences. Backreferences allow you to reuse part of the regex match in the regex, or in the replacement text."> <meta name="keywords" content=""> <link rel=stylesheet href="regex.css" type="text/css"><script src="theme.js" type="text/javascript"></script><link rel="alternate" type="application/rss+xml" title="New at Regular-Expressions.info" href="updates.xml"> </head> <body bgcolor=white text=black> <div id=top></div> <div id=btntop><div id=btngrid><a href="quickstart.html" target="_top"><div>Quick&nbsp;Start</div></a><a href="tutorial.html" target="_top"><div>Tutorial</div></a><a href="tools.html" target="_top"><div>Tools&nbsp;&amp;&nbsp;Languages</div></a><a href="examples.html" target="_top"><div>Examples</div></a><a href="refflavors.html" target="_top"><div>Reference</div></a><a href="books.html" target="_top"><div>Book&nbsp;Reviews</div></a></div></div> <div id=contents><div id=side> <TABLE CLASS=side CELLSPACING=0 CELLPADDING=4><TR><TD CLASS=sideheader>Regex Tutorial</TD></TR><TR><TD><A HREF="tutorial.html" TARGET=_top>Introduction</A></TD></TR><TR><TD><A HREF="tutorialcnt.html" TARGET=_top>Table of Contents</A></TD></TR><TR><TD><A HREF="characters.html" TARGET=_top>Special Characters</A></TD></TR><TR><TD><A HREF="nonprint.html" TARGET=_top>Non-Printable Characters</A></TD></TR><TR><TD><A HREF="engine.html" TARGET=_top>Regex Engine Internals</A></TD></TR><TR><TD><A HREF="charclass.html" TARGET=_top>Character Classes</A></TD></TR><TR><TD><A HREF="charclasssubtract.html" TARGET=_top>Character Class Subtraction</A></TD></TR><TR><TD><A HREF="charclassintersect.html" TARGET=_top>Character Class Intersection</A></TD></TR><TR><TD><A HREF="shorthand.html" TARGET=_top>Shorthand Character Classes</A></TD></TR><TR><TD><A HREF="dot.html" TARGET=_top>Dot</A></TD></TR><TR><TD><A HREF="anchors.html" TARGET=_top>Anchors</A></TD></TR><TR><TD><A HREF="wordboundaries.html" TARGET=_top>Word Boundaries</A></TD></TR><TR><TD><A HREF="alternation.html" TARGET=_top>Alternation</A></TD></TR><TR><TD><A HREF="optional.html" TARGET=_top>Optional Items</A></TD></TR><TR><TD><A HREF="repeat.html" TARGET=_top>Repetition</A></TD></TR><TR><TD><A HREF="brackets.html" TARGET=_top>Grouping &amp; Capturing</A></TD></TR><TR><TD><A HREF="backref.html" TARGET=_top>Backreferences</A></TD></TR><TR><TD><A HREF="backref2.html" TARGET=_top>Backreferences, part 2</A></TD></TR><TR><TD><A HREF="named.html" TARGET=_top>Named Groups</A></TD></TR><TR><TD><A HREF="backrefrel.html" TARGET=_top>Relative Backreferences</A></TD></TR><TR><TD><A HREF="branchreset.html" TARGET=_top>Branch Reset Groups</A></TD></TR><TR><TD><A HREF="freespacing.html" TARGET=_top>Free-Spacing &amp; Comments</A></TD></TR><TR><TD><A HREF="unicode.html" TARGET=_top>Unicode</A></TD></TR><TR><TD><A HREF="modifiers.html" TARGET=_top>Mode Modifiers</A></TD></TR><TR><TD><A HREF="atomic.html" TARGET=_top>Atomic Grouping</A></TD></TR><TR><TD><A HREF="possessive.html" TARGET=_top>Possessive Quantifiers</A></TD></TR><TR><TD><A HREF="lookaround.html" TARGET=_top>Lookahead &amp; Lookbehind</A></TD></TR><TR><TD><A HREF="lookaround2.html" TARGET=_top>Lookaround, part 2</A></TD></TR><TR><TD><A HREF="keep.html" TARGET=_top>Keep Text out of The Match</A></TD></TR><TR><TD><A HREF="conditional.html" TARGET=_top>Conditionals</A></TD></TR><TR><TD><A HREF="balancing.html" TARGET=_top>Balancing Groups</A></TD></TR><TR><TD><A HREF="recurse.html" TARGET=_top>Recursion</A></TD></TR><TR><TD><A HREF="subroutine.html" TARGET=_top>Subroutines</A></TD></TR><TR><TD><A HREF="recurseinfinite.html" TARGET=_top>Infinite Recursion</A></TD></TR><TR><TD><A HREF="recurserepeat.html" TARGET=_top>Recursion &amp; Quantifiers</A></TD></TR><TR><TD><A HREF="recursecapture.html" TARGET=_top>Recursion &amp; Capturing</A></TD></TR><TR><TD><A HREF="recursebackref.html" TARGET=_top>Recursion &amp; Backreferences</A></TD></TR><TR><TD><A HREF="recursebacktrack.html" TARGET=_top>Recursion &amp; Backtracking</A></TD></TR><TR><TD><A HREF="posixbrackets.html" TARGET=_top>POSIX Bracket Expressions</A></TD></TR><TR><TD><A HREF="zerolength.html" TARGET=_top>Zero-Length Matches</A></TD></TR><TR><TD><A HREF="continue.html" TARGET=_top>Continuing Matches</A></TD></TR> </TABLE><TABLE CLASS=side CELLSPACING=0 CELLPADDING=4><TR><TD CLASS=sideheader>More on This Site</TD></TR><TR><TD><A HREF="index.html" TARGET=_top>Introduction</A></TD></TR><TR><TD><A HREF="quickstart.html" TARGET=_top>Regular Expressions Quick Start</A></TD></TR><TR><TD><A HREF="tutorial.html" TARGET=_top>Regular Expressions Tutorial</A></TD></TR><TR><TD><A HREF="replacetutorial.html" TARGET=_top>Replacement Strings Tutorial</A></TD></TR><TR><TD><A HREF="tools.html" TARGET=_top>Applications and Languages</A></TD></TR><TR><TD><A HREF="examples.html" TARGET=_top>Regular Expressions Examples</A></TD></TR><TR><TD><A HREF="refflavors.html" TARGET=_top>Regular Expressions Reference</A></TD></TR><TR><TD><A HREF="refreplace.html" TARGET=_top>Replacement Strings Reference</A></TD></TR><TR><TD><A HREF="books.html" TARGET=_top>Book Reviews</A></TD></TR><TR><TD><A HREF="print.html" TARGET=_top>Printable PDF</A></TD></TR><TR><TD><A HREF="about.html" TARGET=_top>About This Site</A></TD></TR><TR><TD><A HREF="updates.html" TARGET=_top>RSS Feed &amp; Blog</A></TD></TR></TABLE></DIV><div class=bodytext><div class=topad style="height:130px"><A HREF="https://www.regexbuddy.com/create.html" TARGET="_top"><picture><source media="(max-width: 370px)" srcset="ads/320/rxbtutorial100.png 1x, ads/320/rxbtutorial150.png 1.5x, ads/320/rxbtutorial200.png 2x, ads/320/rxbtutorial250.png 2.5x, ads/320/rxbtutorial300.png 3x, ads/320/rxbtutorial350.png 3.5x, ads/320/rxbtutorial400.png 4x"><source media="(max-width: 500px)" srcset="ads/360/rxbtutorial100.png 1x, ads/360/rxbtutorial150.png 1.5x, ads/360/rxbtutorial200.png 2x, ads/360/rxbtutorial250.png 2.5x, ads/360/rxbtutorial300.png 3x, ads/360/rxbtutorial350.png 3.5x, ads/360/rxbtutorial400.png 4x"><source media="(max-width: 660px)" srcset="ads/480/rxbtutorial100.png 1x, ads/480/rxbtutorial150.png 1.5x, ads/480/rxbtutorial200.png 2x, ads/480/rxbtutorial250.png 2.5x, ads/480/rxbtutorial300.png 3x, ads/480/rxbtutorial350.png 3.5x, ads/480/rxbtutorial400.png 4x"><source media="(max-width: 747px)" srcset="ads/640/rxbtutorial100.png 1x, ads/640/rxbtutorial150.png 1.5x, ads/640/rxbtutorial200.png 2x, ads/640/rxbtutorial250.png 2.5x, ads/640/rxbtutorial300.png 3x, ads/640/rxbtutorial350.png 3.5x, ads/640/rxbtutorial400.png 4x"><img src="ads/728/rxbtutorial100.png" srcset="ads/728/rxbtutorial100.png 1x, ads/728/rxbtutorial125.png 1.25x, ads/728/rxbtutorial150.png 1.5x, ads/728/rxbtutorial175.png 1.75x, ads/728/rxbtutorial200.png 2x, ads/728/rxbtutorial250.png 2.5x, ads/728/rxbtutorial300.png 3x, ads/728/rxbtutorial350.png 3.5x, ads/728/rxbtutorial400.png 4x" alt="RegexBuddy—Better than a regular expression tutorial!"></picture></A></div> <div class=bulb><h1>Backreferences to Failed Groups</h1><script type="text/javascript">showbulb();</script></div> <p>The previous topic on <A HREF="backref.html" TARGET="_top">backreferences</A> applies to all regex flavors, except those few that don’t support backreferences at all. Flavors behave differently when you start doing things that don’t fit the “match the text matched by a previous capturing group” job description.</p> <p>There is a difference between a backreference to a capturing group that matched nothing, and one to a capturing group that did not participate in the match at all. The regex <TT CLASS=syntax><SPAN CLASS="regexnest1">(</SPAN><SPAN CLASS="regexplain">q</SPAN><SPAN CLASS="regexspecial">?</SPAN><SPAN CLASS="regexnest1">)</SPAN><SPAN CLASS="regexplain">b</SPAN><SPAN CLASS="regexspecial">\1</SPAN></TT> matches <tt class=match>b</tt>. <TT CLASS=syntax><SPAN CLASS="regexplain">q</SPAN><SPAN CLASS="regexspecial">?</SPAN></TT> is optional and matches nothing, causing <TT CLASS=syntax><SPAN CLASS="regexnest1">(</SPAN><SPAN CLASS="regexplain">q</SPAN><SPAN CLASS="regexspecial">?</SPAN><SPAN CLASS="regexnest1">)</SPAN></TT> to successfully match and capture nothing. <TT CLASS=syntax><SPAN CLASS="regexplain">b</SPAN></TT> matches <tt class=match>b</tt> and <TT CLASS=syntax><SPAN CLASS="regexspecial">\1</SPAN></TT> successfully matches the nothing captured by the group.</p> <p>In most flavors, the regex <TT CLASS=syntax><SPAN CLASS="regexnest1">(</SPAN><SPAN CLASS="regexplain">q</SPAN><SPAN CLASS="regexnest1">)</SPAN><SPAN CLASS="regexspecial">?</SPAN><SPAN CLASS="regexplain">b</SPAN><SPAN CLASS="regexspecial">\1</SPAN></TT> fails to match <tt class=string>b</tt>. <TT CLASS=syntax><SPAN CLASS="regexnest1">(</SPAN><SPAN CLASS="regexplain">q</SPAN><SPAN CLASS="regexnest1">)</SPAN></TT> fails to match at all, so the group never gets to capture anything at all. Because the whole group is optional, the engine does proceed to match <TT CLASS=syntax><SPAN CLASS="regexplain">b</SPAN></TT>. The engine now arrives at <TT CLASS=syntax><SPAN CLASS="regexspecial">\1</SPAN></TT> which references a group that did not participate in the match attempt at all. This causes the backreference to fail to match at all, mimicking the result of the group. Since there’s no <TT CLASS=syntax><SPAN CLASS="regexspecial">?</SPAN></TT> making <TT CLASS=syntax><SPAN CLASS="regexspecial">\1</SPAN></TT> optional, the overall match attempt fails.</p> <p>One of the few exceptions is <A HREF="javascript.html" TARGET="_top">JavaScript</A>. According to the official ECMA standard, a backreference to a non-participating capturing group must successfully match nothing just like a backreference to a participating group that captured nothing does. In other words, in JavaScript, <TT CLASS=syntax><SPAN CLASS="regexnest1">(</SPAN><SPAN CLASS="regexplain">q</SPAN><SPAN CLASS="regexspecial">?</SPAN><SPAN CLASS="regexnest1">)</SPAN><SPAN CLASS="regexplain">b</SPAN><SPAN CLASS="regexspecial">\1</SPAN></TT> and <TT CLASS=syntax><SPAN CLASS="regexnest1">(</SPAN><SPAN CLASS="regexplain">q</SPAN><SPAN CLASS="regexnest1">)</SPAN><SPAN CLASS="regexspecial">?</SPAN><SPAN CLASS="regexplain">b</SPAN><SPAN CLASS="regexspecial">\1</SPAN></TT> both match <tt class=match>b</tt>. <A HREF="xpath.html" TARGET="_top">XPath</A> also works this way.</p> <p>Dinkumware’s implementation of <A HREF="stdregex.html" TARGET="_top">std::regex</A> handles backreferences like JavaScript for all its grammars that support backreferences. <A HREF="boost.html" TARGET="_top">Boost</A> did so too until version 1.46. As of version 1.47, Boost fails backreferences to non-participating groups when using the ECMAScript grammar, but still lets them successfully match nothing when using the basic and grep grammars.</p> <a name="invalid"></a><h2>Backreferences to Non-Existent Capturing Groups</h2> <p>Backreferences to groups that do not exist, such as <TT CLASS=syntax><SPAN CLASS="regexnest1">(</SPAN><SPAN CLASS="regexplain">one</SPAN><SPAN CLASS="regexnest1">)</SPAN><SPAN CLASS="regexerr">\7</SPAN></TT>, are an error in most regex flavors. There are exceptions though. <A HREF="javascript.html" TARGET="_top">JavaScript</A> treats <TT CLASS=syntax><SPAN CLASS="regexspecial">\1</SPAN></TT> through <TT CLASS=syntax><SPAN CLASS="regexspecial">\7</SPAN></TT> as <a href="characters.html#octal">octal escapes</a> when there are fewer capturing groups in the regex than the digit after the backslash. <TT CLASS=syntax><SPAN CLASS="regexescaped">\8</SPAN></TT> and <TT CLASS=syntax><SPAN CLASS="regexescaped">\9</SPAN></TT> are an error because 8 and 9 are not valid octal digits.</p> <p><A HREF="java.html" TARGET="_top">Java</A> treats backreferences to groups that don’t exist as backreferences to groups that exist but never participate in the match. They are not an error, but simply never match anything.</p> <p><A HREF="dotnet.html" TARGET="_top">.NET</A> is a little more complicated. .NET supports single-digit and double-digit backreferences as well as double-digit octal escapes without a leading zero. Backreferences trump octal escapes. So <TT CLASS=syntax><SPAN CLASS="regexspecial">\12</SPAN></TT> is a line feed (octal 12 = decimal 10) in a regex with fewer than 12 capturing groups. It would be a backreference to the 12th group in a regex with 12 or more capturing groups. .NET does not support single-digit octal escapes. So <TT CLASS=syntax><SPAN CLASS="regexerr">\7</SPAN></TT> is an error in a regex with fewer than 7 capturing groups.</p> <a name="forward"></a><h2>Forward References</h2> <p>Many modern regex flavors, including <A HREF="jgsoft.html" TARGET="_top">JGsoft</A>, <A HREF="dotnet.html" TARGET="_top">.NET</A>, <A HREF="java.html" TARGET="_top">Java</A>, <A HREF="perl.html" TARGET="_top">Perl</A>, <A HREF="pcre.html" TARGET="_top">PCRE</A>, <A HREF="php.html" TARGET="_top">PHP</A>, <A HREF="delphi.html" TARGET="_top">Delphi</A>, and <A HREF="ruby.html" TARGET="_top">Ruby</A> allow forward references. They allow you to use a backreference to a group that appears later in the regex. Forward references are obviously only useful if they’re inside a repeated group. Then there can be situations in which the regex engine evaluates the backreference after the group has already matched. Before the group is attempted, the backreference fails like a backreference to a failed group does.</p> <p>If forward references are supported, the regex <TT CLASS=syntax><SPAN CLASS="regexnest1">(</SPAN><SPAN CLASS="regexspecial">\2</SPAN><SPAN CLASS="regexplain">two</SPAN><SPAN CLASS="regexnest1">|</SPAN><SPAN CLASS="regexnest2">(</SPAN><SPAN CLASS="regexplain">one</SPAN><SPAN CLASS="regexnest2">)</SPAN><SPAN CLASS="regexnest1">)</SPAN><SPAN CLASS="regexspecial">+</SPAN></TT> matches <tt class=match>oneonetwo</tt>. At the start of the string, <TT CLASS=syntax><SPAN CLASS="regexspecial">\2</SPAN></TT> fails. Trying the other <A HREF="alternation.html" TARGET="_top">alternative</A>, <tt class=match>one</tt> is matched by the second capturing group, and subsequently by the first group. The first group is then repeated. This time, <TT CLASS=syntax><SPAN CLASS="regexspecial">\2</SPAN></TT> matches <tt class=match>one</tt> as captured by the second group. <TT CLASS=syntax><SPAN CLASS="regexplain">two</SPAN></TT> then matches <tt class=match>two</tt>. With two repetitions of the first group, the regex has matched the whole subject string.</p> <p><A HREF="javascript.html" TARGET="_top">JavaScript</A> does not support forward references, but does not treat them as an error. In JavaScript, forward references always find a zero-length match, just as backreferences to non-participating groups do in JavaScript. Because this is not particularly useful, <A HREF="xregexp.html" TARGET="_top">XRegExp</A> makes them an error. In <A HREF="stdregex.html" TARGET="_top">std::regex</A>, <A HREF="boost.html" TARGET="_top">Boost</A>, <A HREF="python.html" TARGET="_top">Python</A>, <A HREF="tcl.html" TARGET="_top">Tcl</A>, and <A HREF="vbscript.html" TARGET="_top">VBScript</A> forward references are an error.</p> <a name="nested"></a><h2>Nested References</h2> <p>A nested reference is a backreference inside the capturing group that it references. Like forward references, nested references are only useful if they’re inside a repeated group, as in <TT CLASS=syntax><SPAN CLASS="regexnest1">(</SPAN><SPAN CLASS="regexspecial">\1</SPAN><SPAN CLASS="regexplain">two</SPAN><SPAN CLASS="regexnest1">|</SPAN><SPAN CLASS="regexnest2">(</SPAN><SPAN CLASS="regexplain">one</SPAN><SPAN CLASS="regexnest2">)</SPAN><SPAN CLASS="regexnest1">)</SPAN><SPAN CLASS="regexspecial">+</SPAN></TT>. When nested references are supported, this regex also matches <tt class=match>oneonetwo</tt>. At the start of the string, <TT CLASS=syntax><SPAN CLASS="regexspecial">\1</SPAN></TT> fails. Trying the other <A HREF="alternation.html" TARGET="_top">alternative</A>, <tt class=match>one</tt> is matched by the second capturing group, and subsequently by the first group. The first group is then repeated. This time, <TT CLASS=syntax><SPAN CLASS="regexspecial">\1</SPAN></TT> matches <tt class=match>one</tt> as captured by the last iteration of the first group. It doesn’t matter that the regex engine has re-entered the first group. The text matched by the group was stored into the backreference when the group was previously exited. <TT CLASS=syntax><SPAN CLASS="regexplain">two</SPAN></TT> then matches <tt class=match>two</tt>. With two repetitions of the first group, the regex has matched the whole subject string. If you retrieve the text from the capturing groups after the match, the first group stores <tt class=match>onetwo</tt> while the second group captured the first occurrence of <tt class=match>one</tt> in the string.</p> <p>The <A HREF="jgsoft.html" TARGET="_top">JGsoft</A>, <A HREF="dotnet.html" TARGET="_top">.NET</A>, <A HREF="java.html" TARGET="_top">Java</A>, <A HREF="perl.html" TARGET="_top">Perl</A>, and <A HREF="vbscript.html" TARGET="_top">VBScript</A> flavors all support nested references. <A HREF="pcre.html" TARGET="_top">PCRE</A> does too, but had bugs with backtracking into capturing groups with nested backreferences. Instead of fixing the bugs, PCRE 8.01 worked around them by forcing capturing groups with nested references to be <A HREF="atomic.html" TARGET="_top">atomic</A>. So in PCRE, <TT CLASS=syntax><SPAN CLASS="regexnest1">(</SPAN><SPAN CLASS="regexspecial">\1</SPAN><SPAN CLASS="regexplain">two</SPAN><SPAN CLASS="regexnest1">|</SPAN><SPAN CLASS="regexnest2">(</SPAN><SPAN CLASS="regexplain">one</SPAN><SPAN CLASS="regexnest2">)</SPAN><SPAN CLASS="regexnest1">)</SPAN><SPAN CLASS="regexspecial">+</SPAN></TT> is the same as <TT CLASS=syntax><SPAN CLASS="regexnest1">(?&gt;</SPAN><SPAN CLASS="regexnest2">(</SPAN><SPAN CLASS="regexspecial">\1</SPAN><SPAN CLASS="regexplain">two</SPAN><SPAN CLASS="regexnest2">|</SPAN><SPAN CLASS="regexnest3">(</SPAN><SPAN CLASS="regexplain">one</SPAN><SPAN CLASS="regexnest3">)</SPAN><SPAN CLASS="regexnest2">)</SPAN><SPAN CLASS="regexnest1">)</SPAN><SPAN CLASS="regexspecial">+</SPAN></TT>. This affects languages with regex engines based on PCRE, such as <A HREF="php.html" TARGET="_top">PHP</A>, <A HREF="delphi.html" TARGET="_top">Delphi</A>, and <A HREF="rlanguage.html" TARGET="_top">R</A>.</p> <p><A HREF="javascript.html" TARGET="_top">JavaScript</A> and <A HREF="ruby.html" TARGET="_top">Ruby</A> do not support nested references, but treat them as backreferences to non-participating groups instead of as errors. In JavaScript that means they always match a zero-length string, while in Ruby they always fail to match. In <A HREF="stdregex.html" TARGET="_top">std::regex</A>, <A HREF="boost.html" TARGET="_top">Boost</A>, <A HREF="python.html" TARGET="_top">Python</A>, and <A HREF="tcl.html" TARGET="_top">Tcl</A>, nested references are an error.</p> <div id=cntmobi><p>|&ensp;<a href='quickstart.html'>Quick&nbsp;Start</a>&ensp;|&ensp;<a href='tutorial.html'>Tutorial</a>&ensp;|&ensp;<a href='tools.html'>Tools&nbsp;&amp;&nbsp;Languages</a>&ensp;|&ensp;<a href='examples.html'>Examples</a>&ensp;|&ensp;<a href='refflavors.html'>Reference</a>&ensp;|&ensp;<a href='books.html'>Book&nbsp;Reviews</a>&ensp;|</p><p>|&ensp;<a href='tutorial.html'>Introduction</a>&ensp;|&ensp;<a href='tutorialcnt.html'>Table of Contents</a>&ensp;|&ensp;<a href='characters.html'>Special Characters</a>&ensp;|&ensp;<a href='nonprint.html'>Non-Printable Characters</a>&ensp;|&ensp;<a href='engine.html'>Regex Engine Internals</a>&ensp;|&ensp;<a href='charclass.html'>Character Classes</a>&ensp;|&ensp;<a href='charclasssubtract.html'>Character Class Subtraction</a>&ensp;|&ensp;<a href='charclassintersect.html'>Character Class Intersection</a>&ensp;|&ensp;<a href='shorthand.html'>Shorthand Character Classes</a>&ensp;|&ensp;<a href='dot.html'>Dot</a>&ensp;|&ensp;<a href='anchors.html'>Anchors</a>&ensp;|&ensp;<a href='wordboundaries.html'>Word Boundaries</a>&ensp;|&ensp;<a href='alternation.html'>Alternation</a>&ensp;|&ensp;<a href='optional.html'>Optional Items</a>&ensp;|&ensp;<a href='repeat.html'>Repetition</a>&ensp;|&ensp;<a href='brackets.html'>Grouping &amp; Capturing</a>&ensp;|&ensp;<a href='backref.html'>Backreferences</a>&ensp;|&ensp;<a href='backref2.html'>Backreferences, part 2</a>&ensp;|&ensp;<a href='named.html'>Named Groups</a>&ensp;|&ensp;<a href='backrefrel.html'>Relative Backreferences</a>&ensp;|&ensp;<a href='branchreset.html'>Branch Reset Groups</a>&ensp;|&ensp;<a href='freespacing.html'>Free-Spacing &amp; Comments</a>&ensp;|&ensp;<a href='unicode.html'>Unicode</a>&ensp;|&ensp;<a href='modifiers.html'>Mode Modifiers</a>&ensp;|&ensp;<a href='atomic.html'>Atomic Grouping</a>&ensp;|&ensp;<a href='possessive.html'>Possessive Quantifiers</a>&ensp;|&ensp;<a href='lookaround.html'>Lookahead &amp; Lookbehind</a>&ensp;|&ensp;<a href='lookaround2.html'>Lookaround, part 2</a>&ensp;|&ensp;<a href='keep.html'>Keep Text out of The Match</a>&ensp;|&ensp;<a href='conditional.html'>Conditionals</a>&ensp;|&ensp;<a href='balancing.html'>Balancing Groups</a>&ensp;|&ensp;<a href='recurse.html'>Recursion</a>&ensp;|&ensp;<a href='subroutine.html'>Subroutines</a>&ensp;|&ensp;<a href='recurseinfinite.html'>Infinite Recursion</a>&ensp;|&ensp;<a href='recurserepeat.html'>Recursion &amp; Quantifiers</a>&ensp;|&ensp;<a href='recursecapture.html'>Recursion &amp; Capturing</a>&ensp;|&ensp;<a href='recursebackref.html'>Recursion &amp; Backreferences</a>&ensp;|&ensp;<a href='recursebacktrack.html'>Recursion &amp; Backtracking</a>&ensp;|&ensp;<a href='posixbrackets.html'>POSIX Bracket Expressions</a>&ensp;|&ensp;<a href='zerolength.html'>Zero-Length Matches</a>&ensp;|&ensp;<a href='continue.html'>Continuing Matches</a>&ensp;|</p></div> <div id=copyright> <P CLASS=copyright>Page URL: <A HREF="https://www.regular-expressions.info/backref2.html" TARGET="_top">https://www.regular-expressions.info/backref2.html</A><BR> Page last updated: 22 November 2019<BR> Site last updated: 06 November 2024<BR> Copyright &copy; 2003-2024 Jan Goyvaerts. All rights reserved.</P> </div> </div> </div> </body></html>

Pages: 1 2 3 4 5 6 7 8 9 10