CINXE.COM

<!DOCTYPE html> <html lang="en"><head><meta charset="utf-8"><link rel=canonical href='https://https://www.regular-expressions.info//refquick.html'><title></title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="author" content="Jan Goyvaerts"> <meta name="description" content="Quick reference of the various syntactic elements that can appear in regular expressions"> <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 Reference</TD></TR><TR><TD><A HREF="reference.html" TARGET=_top>Introduction</A></TD></TR><TR><TD><A HREF="refflavors.html" TARGET=_top>Table of Contents</A></TD></TR><TR><TD><A HREF="refquick.html" TARGET=_top>Quick Reference</A></TD></TR><TR><TD><A HREF="refcharacters.html" TARGET=_top>Characters</A></TD></TR><TR><TD><A HREF="refbasic.html" TARGET=_top>Basic Features</A></TD></TR><TR><TD><A HREF="refcharclass.html" TARGET=_top>Character Classes</A></TD></TR><TR><TD><A HREF="refshorthand.html" TARGET=_top>Shorthands</A></TD></TR><TR><TD><A HREF="refanchors.html" TARGET=_top>Anchors</A></TD></TR><TR><TD><A HREF="refwordboundaries.html" TARGET=_top>Word Boundaries</A></TD></TR><TR><TD><A HREF="refrepeat.html" TARGET=_top>Quantifiers</A></TD></TR><TR><TD><A HREF="refunicode.html" TARGET=_top>Unicode</A></TD></TR><TR><TD><A HREF="refcapture.html" TARGET=_top>Capturing Groups &amp; Backreferences</A></TD></TR><TR><TD><A HREF="refext.html" TARGET=_top>Named Groups &amp; Backreferences</A></TD></TR><TR><TD><A HREF="refadv.html" TARGET=_top>Special Groups</A></TD></TR><TR><TD><A HREF="refmodifiers.html" TARGET=_top>Mode Modifiers</A></TD></TR><TR><TD><A HREF="refrecurse.html" TARGET=_top>Recursion &amp; Balancing Groups</A></TD></TR> </TABLE><TABLE CLASS=side CELLSPACING=0 CELLPADDING=4><TR><TD CLASS=sideheader>Replacement Reference</TD></TR><TR><TD><A HREF="refreplacecharacters.html" TARGET=_top>Characters</A></TD></TR><TR><TD><A HREF="refreplacebackref.html" TARGET=_top>Matched Text &amp; Backreferences</A></TD></TR><TR><TD><A HREF="refreplacecase.html" TARGET=_top>Context &amp; Case Conversion</A></TD></TR><TR><TD><A HREF="refreplaceconditional.html" TARGET=_top>Conditionals</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/benefits.html" TARGET="_top"><picture><source media="(max-width: 370px)" srcset="ads/320/rxbreference100.png 1x, ads/320/rxbreference150.png 1.5x, ads/320/rxbreference200.png 2x, ads/320/rxbreference250.png 2.5x, ads/320/rxbreference300.png 3x, ads/320/rxbreference350.png 3.5x, ads/320/rxbreference400.png 4x"><source media="(max-width: 500px)" srcset="ads/360/rxbreference100.png 1x, ads/360/rxbreference150.png 1.5x, ads/360/rxbreference200.png 2x, ads/360/rxbreference250.png 2.5x, ads/360/rxbreference300.png 3x, ads/360/rxbreference350.png 3.5x, ads/360/rxbreference400.png 4x"><source media="(max-width: 660px)" srcset="ads/480/rxbreference100.png 1x, ads/480/rxbreference150.png 1.5x, ads/480/rxbreference200.png 2x, ads/480/rxbreference250.png 2.5x, ads/480/rxbreference300.png 3x, ads/480/rxbreference350.png 3.5x, ads/480/rxbreference400.png 4x"><source media="(max-width: 747px)" srcset="ads/640/rxbreference100.png 1x, ads/640/rxbreference150.png 1.5x, ads/640/rxbreference200.png 2x, ads/640/rxbreference250.png 2.5x, ads/640/rxbreference300.png 3x, ads/640/rxbreference350.png 3.5x, ads/640/rxbreference400.png 4x"><img src="ads/728/rxbreference100.png" srcset="ads/728/rxbreference100.png 1x, ads/728/rxbreference125.png 1.25x, ads/728/rxbreference150.png 1.5x, ads/728/rxbreference175.png 1.75x, ads/728/rxbreference200.png 2x, ads/728/rxbreference250.png 2.5x, ads/728/rxbreference300.png 3x, ads/728/rxbreference350.png 3.5x, ads/728/rxbreference400.png 4x" alt="RegexBuddy—Better than a regular expression reference!"></picture></A></div> <div class=bulb><h1>Regular Expressions Quick Reference</h1><script type="text/javascript">showbulb();</script></div> <p>This quick reference is a summary of all the regex syntax that is listed in the <A HREF="refflavors.html" TARGET="_top">full reference tables</A>, without any explanation. You can use this table if you’ve seen some syntax in somebody else’s regex and you have no idea what feature that syntax is for. Follow the link to learn more about the syntax in the tutorial. Since the full reference tables cover a variety of regex flavors, this quick reference may have multiple entries for the same syntax with links to different sections in the tutorial if different regex flavors use the same syntax for different features.</p> <p>If you already know the feature you want but forgot which syntax to use, look up the feature in the <A HREF="refflavors.html" TARGET="_top">regex reference table of contents</A> instead.</p> <table class=reference> <tr><th>Syntax</th><th>Feature</th></tr> <tr><td>Any character except <tt>[\^$.|?*+()</tt></td><td><A HREF="characters.html" TARGET="_top">Literal character</A></td></tr> <tr><td><tt>\</tt> followed by any of <tt>[\^$.|?*+(){}</tt></td><td><a href="characters.html#special">Backslash escapes a metacharacter</a></td></tr> <tr><td><tt>.</tt></td><td><A HREF="dot.html" TARGET="_top">Any character</A></td></tr> <tr><td><tt>|</tt></td><td><A HREF="alternation.html" TARGET="_top">Alternation</A></td></tr> <tr><td><tt>\|</tt></td><td><A HREF="alternation.html" TARGET="_top">Alternation</A></td></tr> <tr><td><tt>?</tt></td><td><A HREF="optional.html" TARGET="_top">Greedy quantifier</A></td></tr> <tr><td><tt>\?</tt></td><td><A HREF="optional.html" TARGET="_top">Greedy quantifier</A></td></tr> <tr><td><tt>??</tt></td><td><a href="repeat.html#lazy">Lazy quantifier</a></td></tr> <tr><td><tt>?+</tt></td><td><A HREF="possessive.html" TARGET="_top">Possessive quantifier</A></td></tr> <tr><td><tt>*</tt></td><td><A HREF="repeat.html" TARGET="_top">Greedy quantifier</A></td></tr> <tr><td><tt>*?</tt></td><td><a href="repeat.html#lazy">Lazy quantifier</a></td></tr> <tr><td><tt>*+</tt></td><td><A HREF="possessive.html" TARGET="_top">Possessive quantifier</A></td></tr> <tr><td><tt>+</tt></td><td><A HREF="repeat.html" TARGET="_top">Greedy quantifier</A></td></tr> <tr><td><tt>\+</tt></td><td><A HREF="repeat.html" TARGET="_top">Greedy quantifier</A></td></tr> <tr><td><tt>+?</tt></td><td><a href="repeat.html#lazy">Lazy quantifier</a></td></tr> <tr><td><tt>++</tt></td><td><A HREF="possessive.html" TARGET="_top">Possessive quantifier</A></td></tr> <tr><td><tt>{</tt> and <tt>}</tt></td><td><A HREF="characters.html" TARGET="_top">Literal curly braces</A></td></tr> <tr><td><tt>{n}</tt> where n is an integer &gt;= 1</td><td><A HREF="repeat.html" TARGET="_top">Fixed quantifier</A></td></tr> <tr><td><tt>{n,m}</tt> where n &gt;= 0 and m &gt;= n</td><td><A HREF="repeat.html" TARGET="_top">Greedy quantifier</A></td></tr> <tr><td><tt>{n,}</tt> where n &gt;= 0</td><td><A HREF="repeat.html" TARGET="_top">Greedy quantifier</A></td></tr> <tr><td><tt>{,m}</tt> where m &gt;= 1</td><td><A HREF="repeat.html" TARGET="_top">Greedy quantifier</A></td></tr> <tr><td><tt>\{n\}</tt> where n is an integer &gt;= 1</td><td><A HREF="repeat.html" TARGET="_top">Fixed quantifier</A></td></tr> <tr><td><tt>\{n,m\}</tt> where n &gt;= 0 and m &gt;= n</td><td><A HREF="repeat.html" TARGET="_top">Greedy quantifier</A></td></tr> <tr><td><tt>\{n,\}</tt> where n &gt;= 0</td><td><A HREF="repeat.html" TARGET="_top">Greedy quantifier</A></td></tr> <tr><td><tt>\{,m\}</tt> where m &gt;= 1</td><td><A HREF="repeat.html" TARGET="_top">Greedy quantifier</A></td></tr> <tr><td><tt>{n,m}?</tt> where n &gt;= 0 and m &gt;= n</td><td><a href="repeat.html#lazy">Lazy quantifier</a></td></tr> <tr><td><tt>{n,}?</tt> where n &gt;= 0</td><td><a href="repeat.html#lazy">Lazy quantifier</a></td></tr> <tr><td><tt>{,m}?</tt> where m &gt;= 1</td><td><a href="repeat.html#lazy">Lazy quantifier</a></td></tr> <tr><td><tt>{n,m}+</tt> where n &gt;= 0 and m &gt;= n</td><td><A HREF="possessive.html" TARGET="_top">Possessive quantifier</A></td></tr> <tr><td><tt>{n,}+</tt> where n &gt;= 0</td><td><A HREF="possessive.html" TARGET="_top">Possessive quantifier</A></td></tr> <tr><td><tt>^</tt></td><td><A HREF="anchors.html" TARGET="_top">String anchor</A></td></tr> <tr><td><tt>^</tt></td><td><a href="anchors.html#multi">Line anchor</a></td></tr> <tr><td><tt>$</tt></td><td><A HREF="anchors.html" TARGET="_top">String anchor</A></td></tr> <tr><td><tt>$</tt></td><td><a href="anchors.html#multi">Line anchor</a></td></tr> <tr><td><tt>\a</tt></td><td><A HREF="nonprint.html" TARGET="_top">Character escape</A></td></tr> <tr><td><tt>\A</tt></td><td><a href="anchors.html#az">String anchor</a></td></tr> <tr><td><tt>\A</tt></td><td><A HREF="continue.html" TARGET="_top">Attempt anchor</A></td></tr> <tr><td><tt>\b</tt></td><td><A HREF="wordboundaries.html" TARGET="_top">Word boundary</A></td></tr> <tr><td><tt>\b</tt></td><td><A HREF="nonprint.html" TARGET="_top">Backspace character</A></td></tr> <tr><td><tt>\B</tt></td><td><A HREF="wordboundaries.html" TARGET="_top">Word non-boundary</A></td></tr> <tr><td><tt>\B</tt></td><td><A HREF="nonprint.html" TARGET="_top">Backslash character</A></td></tr> <tr><td><tt>\c</tt></td><td><a href="shorthand.html#xml">XML shorthand</a></td></tr> <tr><td><tt>\ca</tt> through <tt>\cz</tt></td><td><A HREF="nonprint.html" TARGET="_top">Control character escape</A></td></tr> <tr><td><tt>\cA</tt> through <tt>\cZ</tt></td><td><A HREF="nonprint.html" TARGET="_top">Control character escape</A></td></tr> <tr><td><tt>\C</tt></td><td><a href="shorthand.html#xml">XML shorthand</a></td></tr> <tr><td><tt>\d</tt></td><td><A HREF="shorthand.html" TARGET="_top">Digits shorthand</A></td></tr> <tr><td><tt>\D</tt></td><td><A HREF="shorthand.html" TARGET="_top">Non-digits shorthand</A></td></tr> <tr><td><tt>\e</tt></td><td><A HREF="nonprint.html" TARGET="_top">Escape character</A></td></tr> <tr><td><tt>\f</tt></td><td><A HREF="nonprint.html" TARGET="_top">Form feed character</A></td></tr> <tr><td><tt>\g{name}</tt></td><td><A HREF="named.html" TARGET="_top">Named backreference</A></td></tr> <tr><td><tt>\g-1</tt>, <tt>\g-2</tt>, etc.</td><td><A HREF="backrefrel.html" TARGET="_top">Relative Backreference</A></td></tr> <tr><td><tt>\g{-1}</tt>, <tt>\g{-2}</tt>, etc.</td><td><A HREF="backrefrel.html" TARGET="_top">Relative Backreference</A></td></tr> <tr><td><tt>\g1</tt> through <tt>\g99</tt></td><td><A HREF="backref.html" TARGET="_top">Backreference</A></td></tr> <tr><td><tt>\g{1}</tt> through <tt>\g{99}</tt></td><td><A HREF="backref.html" TARGET="_top">Backreference</A></td></tr> <tr><td><tt>\g&lt;name&gt;</tt> where “name” is the name of a capturing group</td><td><A HREF="subroutine.html" TARGET="_top">Named subroutine call</A></td></tr> <tr><td><tt>\g&lt;name&gt;</tt> where “name” is the name of a capturing group</td><td><a href="named.html#boost">Named backreference</a></td></tr> <tr><td><tt>\g&apos;name&apos;</tt> where “name” is the name of a capturing group</td><td><A HREF="subroutine.html" TARGET="_top">Named subroutine call</A></td></tr> <tr><td><tt>\g&apos;name&apos;</tt> where “name” is the name of a capturing group</td><td><a href="named.html#boost">Named backreference</a></td></tr> <tr><td><tt>\g&lt;0&gt;</tt></td><td><A HREF="recurse.html" TARGET="_top">Recursion</A></td></tr> <tr><td><tt>\g&apos;0&apos;</tt></td><td><A HREF="subroutine.html" TARGET="_top">Recursion</A></td></tr> <tr><td><tt>\g&lt;1&gt;</tt> where 1 is the number of a capturing group</td><td><A HREF="subroutine.html" TARGET="_top">Subroutine call</A></td></tr> <tr><td><tt>\g&lt;1&gt;</tt> where 1 is the number of a capturing group</td><td><a href="named.html#boost">Backreference</a></td></tr> <tr><td><tt>\g&apos;1&apos;</tt> where 1 is the number of a capturing group</td><td><A HREF="subroutine.html" TARGET="_top">Subroutine call</A></td></tr> <tr><td><tt>\g&apos;1&apos;</tt> where 1 is the number of a capturing group</td><td><a href="named.html#boost">Backreference</a></td></tr> <tr><td><tt>\g&lt;-1&gt;</tt> where -1 is a negative integer</td><td><A HREF="subroutine.html" TARGET="_top">Relative subroutine call</A></td></tr> <tr><td><tt>\g&lt;-1&gt;</tt> where -1 is a negative integer</td><td><A HREF="backrefrel.html" TARGET="_top">Relative backreference</A></td></tr> <tr><td><tt>\g&apos;-1&apos;</tt> where -1 is a negative integer</td><td><A HREF="subroutine.html" TARGET="_top">Relative subroutine call</A></td></tr> <tr><td><tt>\g&apos;-1&apos;</tt> where -1 is a negative integer</td><td><A HREF="backrefrel.html" TARGET="_top">Relative backreference</A></td></tr> <tr><td><tt>\g&lt;+1&gt;</tt> where +1 is a positive integer</td><td><A HREF="subroutine.html" TARGET="_top">Forward subroutine call</A></td></tr> <tr><td><tt>\g&apos;+1&apos;</tt> where +1 is a positive integer</td><td><A HREF="subroutine.html" TARGET="_top">Forward subroutine call</A></td></tr> <tr><td><tt>\G</tt></td><td><A HREF="continue.html" TARGET="_top">Attempt anchor</A></td></tr> <tr><td><tt>\G</tt></td><td><A HREF="continue.html" TARGET="_top">Match anchor</A></td></tr> <tr><td><tt>\h</tt></td><td><a href="shorthand.html#more">Hexadecimal digit shorthand</a></td></tr> <tr><td><tt>\h</tt></td><td><a href="shorthand.html#more">Horizontal whitespace shorthand</a></td></tr> <tr><td><tt>\H</tt></td><td><a href="shorthand.html#more">Non-hexadecimal digit shorthand</a></td></tr> <tr><td><tt>\H</tt></td><td><a href="shorthand.html#more">Non-horizontal whitespace shorthand</a></td></tr> <tr><td><tt>\i</tt></td><td><a href="shorthand.html#xml">XML shorthand</a></td></tr> <tr><td><tt>\I</tt></td><td><a href="shorthand.html#xml">XML shorthand</a></td></tr> <tr><td><tt>\k&lt;name&gt;</tt></td><td><A HREF="named.html" TARGET="_top">Named backreference</A></td></tr> <tr><td><tt>\k&apos;name&apos;</tt> through <tt>\k&apos;99&apos;</tt></td><td><A HREF="named.html" TARGET="_top">Named backreference</A></td></tr> <tr><td><tt>\k{name}</tt></td><td><A HREF="named.html" TARGET="_top">Named backreference</A></td></tr> <tr><td><tt>\k&lt;1&gt;</tt> through <tt>\k&lt;99&gt;</tt></td><td><A HREF="backref.html" TARGET="_top">Backreference</A></td></tr> <tr><td><tt>\k&apos;1&apos;</tt> through <tt>\k&apos;99&apos;</tt></td><td><A HREF="backref.html" TARGET="_top">Backreference</A></td></tr> <tr><td><tt>\k&lt;-1&gt;</tt>, <tt>\k&lt;-2&gt;</tt>, etc.</td><td><A HREF="backrefrel.html" TARGET="_top">Relative Backreference</A></td></tr> <tr><td><tt>\k&apos;-1&apos;</tt>, <tt>\k&apos;-2&apos;</tt>, etc.</td><td><A HREF="backrefrel.html" TARGET="_top">Relative Backreference</A></td></tr> <tr><td><tt class=code>\K</tt></td><td><A HREF="keep.html" TARGET="_top">Keep text out of the regex match</A></td></tr> <tr><td><tt>\l</tt></td><td><a href="shorthand.html#more">Lowercase shorthand</a></td></tr> <tr><td><tt>\L</tt></td><td><a href="shorthand.html#more">Non-lowercase shorthand</a></td></tr> <tr><td><tt>\m</tt></td><td><a href="wordboundaries.html#tcl">Tcl start of word boundary</a></td></tr> <tr><td><tt>\M</tt></td><td><a href="wordboundaries.html#tcl">Tcl end of word boundary</a></td></tr> <tr><td><tt>\n</tt></td><td><A HREF="nonprint.html" TARGET="_top">Line feed character</A></td></tr> <tr><td><tt>\N</tt></td><td><a href="dot.html#n">Not a line break</a></td></tr> <tr><td>Literal CRLF, LF, or CR line break</td><td><A HREF="nonprint.html" TARGET="_top">Line break</A></td></tr> <tr><td><tt>\o{7777}</tt> where 7777 is any octal number</td><td><A HREF="nonprint.html" TARGET="_top">Octal escape</A></td></tr> <tr><td><tt>\pL</tt> where L is a <a href="unicode.html#category">Unicode category</a></td><td><a href="unicode.html#category">Unicode category</a></td></tr> <tr><td><tt>\PL</tt> where L is a <a href="unicode.html#category">Unicode category</a></td><td><a href="unicode.html#category">Unicode category</a></td></tr> <tr><td><tt>\p{L}</tt> where L is a <a href="unicode.html#category">Unicode category</a></td><td><a href="unicode.html#category">Unicode category</a></td></tr> <tr><td><tt>\p{IsL}</tt> where L is a <a href="unicode.html#category">Unicode category</a></td><td><a href="unicode.html#category">Unicode category</a></td></tr> <tr><td><tt>\p{Category}</tt></td><td><a href="unicode.html#category">Unicode category</a></td></tr> <tr><td><tt>\p{IsCategory}</tt></td><td><a href="unicode.html#category">Unicode category</a></td></tr> <tr><td><tt>\p{Script}</tt></td><td><a href="unicode.html#script">Unicode script</a></td></tr> <tr><td><tt>\p{IsScript}</tt></td><td><a href="unicode.html#script">Unicode script</a></td></tr> <tr><td><tt>\p{Block}</tt></td><td><a href="unicode.html#block">Unicode block</a></td></tr> <tr><td><tt>\p{InBlock}</tt></td><td><a href="unicode.html#block">Unicode block</a></td></tr> <tr><td><tt>\p{IsBlock}</tt></td><td><a href="unicode.html#block">Unicode block</a></td></tr> <tr><td><tt>\P{Property}</tt></td><td><A HREF="unicode.html" TARGET="_top">Negated Unicode property</A></td></tr> <tr><td><tt>\p{^Property}</tt></td><td><A HREF="unicode.html" TARGET="_top">Negated Unicode property</A></td></tr> <tr><td><tt>\P{^Property}</tt></td><td><A HREF="unicode.html" TARGET="_top">Unicode property</A></td></tr> <tr><td><tt>\Q…\E</tt></td><td><a href="characters.html#special">Escape sequence</a></td></tr> <tr><td><tt>\r</tt></td><td><A HREF="nonprint.html" TARGET="_top">Carriage return character</A></td></tr> <tr><td><tt>\R</tt></td><td><A HREF="nonprint.html" TARGET="_top">Line break</A></td></tr> <tr><td><tt>\s</tt></td><td><A HREF="shorthand.html" TARGET="_top">Whitespace shorthand</A></td></tr> <tr><td><tt>\S</tt></td><td><A HREF="shorthand.html" TARGET="_top">Non-whitespace shorthand</A></td></tr> <tr><td><tt>\t</tt></td><td><A HREF="nonprint.html" TARGET="_top">Tab character</A></td></tr> <tr><td><tt>\u</tt></td><td><a href="shorthand.html#more">Uppercase shorthand</a></td></tr> <tr><td><tt>\uFFFF</tt> where FFFF are 4 hexadecimal digits</td><td><a href="unicode.html#codepoint">Unicode code point</a></td></tr> <tr><td><tt>\u{FFFF}</tt> where FFFF are 1 to 4 hexadecimal digits</td><td><a href="unicode.html#codepoint">Unicode code point</a></td></tr> <tr><td><tt>\U</tt></td><td><a href="shorthand.html#more">Non-uppercase shorthand</a></td></tr> <tr><td><tt>\v</tt></td><td><A HREF="nonprint.html" TARGET="_top">Vertical tab character</A></td></tr> <tr><td><tt>\v</tt></td><td><a href="shorthand.html#more">Vertical whitespace shorthand</a></td></tr> <tr><td><tt>\V</tt></td><td><a href="shorthand.html#more">Non-vertical whitespace shorthand</a></td></tr> <tr><td><tt>\w</tt></td><td><A HREF="shorthand.html" TARGET="_top">Word character shorthand</A></td></tr> <tr><td><tt>\W</tt></td><td><A HREF="shorthand.html" TARGET="_top">Non-word character shorthand</A></td></tr> <tr><td><tt>\xFF</tt> where FF are 2 hexadecimal digits </td><td><A HREF="nonprint.html" TARGET="_top">Hexadecimal escape</A></td></tr> <tr><td><tt>\xFFFF</tt> where FFFF are 4 hexadecimal digits</td><td><a href="unicode.html#codepoint">Unicode code point</a></td></tr> <tr><td><tt>\x{FFFF}</tt> where FFFF are 1 to 4 hexadecimal digits</td><td><a href="unicode.html#codepoint">Unicode code point</a></td></tr> <tr><td><tt>\X</tt></td><td><a href="unicode.html#grapheme">Unicode grapheme</a></td></tr> <tr><td><tt>\y</tt></td><td><a href="wordboundaries.html#tcl">Tcl word boundary</a></td></tr> <tr><td><tt>\Y</tt></td><td><a href="wordboundaries.html#tcl">Tcl word non-boundary</a></td></tr> <tr><td><tt>\Z</tt></td><td><a href="anchors.html#az">String anchor</a></td></tr> <tr><td><tt>\z</tt></td><td><a href="anchors.html#az">String anchor</a></td></tr> <tr><td><tt>\0</tt></td><td><A HREF="nonprint.html" TARGET="_top">NULL escape</A></td></tr> <tr><td><tt>\1</tt> through <tt>\7</tt></td><td><A HREF="nonprint.html" TARGET="_top">Octal escape</A></td></tr> <tr><td><tt>\1</tt> through <tt>\9</tt></td><td><A HREF="backref.html" TARGET="_top">Backreference</A></td></tr> <tr><td><tt>\10</tt> through <tt>\77</tt></td><td><A HREF="nonprint.html" TARGET="_top">Octal escape</A></td></tr> <tr><td><tt>\10</tt> through <tt>\99</tt></td><td><A HREF="backref.html" TARGET="_top">Backreference</A></td></tr> <tr><td><tt>\100</tt> through <tt>\377</tt></td><td><A HREF="nonprint.html" TARGET="_top">Octal escape</A></td></tr> <tr><td><tt>\01</tt> through <tt>\0377</tt></td><td><A HREF="nonprint.html" TARGET="_top">Octal escape</A></td></tr> <tr><td><tt>\&#96;</tt></td><td><a href="anchors.html#gnu">String anchor</a></td></tr> <tr><td><tt>\&#96;</tt></td><td><A HREF="continue.html" TARGET="_top">Attempt anchor</A></td></tr> <tr><td><tt>\&apos;</tt></td><td><a href="anchors.html#gnu">String anchor</a></td></tr> <tr><td><tt>\&lt;</tt></td><td><a href="wordboundaries.html#gnu">GNU word boundary</a></td></tr> <tr><td><tt>\&gt;</tt></td><td><a href="wordboundaries.html#gnu">GNU word boundary</a></td></tr> <tr><td><tt>[[:&lt;:]]</tt></td><td><a href="wordboundaries.html#posix">POSIX word boundary</a></td></tr> <tr><td><tt>[[:&gt;:]]</tt></td><td><a href="wordboundaries.html#posix">POSIX word boundary</a></td></tr> <tr><td><tt>(regex)</tt></td><td><A HREF="brackets.html" TARGET="_top">Capturing group</A></td></tr> <tr><td><tt>\(regex\)</tt></td><td><A HREF="brackets.html" TARGET="_top">Capturing group</A></td></tr> <tr><td><tt>(?:regex)</tt></td><td><A HREF="brackets.html" TARGET="_top">Non-capturing group</A></td></tr> <tr><td><tt>(?&lt;name&gt;regex)</tt></td><td><A HREF="named.html" TARGET="_top">Named capturing group</A></td></tr> <tr><td><tt>(?&apos;name&apos;regex)</tt></td><td><A HREF="named.html" TARGET="_top">Named capturing group</A></td></tr> <tr><td><tt class=code>(?#comment)</tt></td><td><a href="freespacing.html#parenscomment">Comment</a></td></tr> <tr><td><tt class=code>(?|regex)</tt></td><td><A HREF="branchreset.html" TARGET="_top">Branch reset group</A></td></tr> <tr><td><tt class=code>(?&gt;regex)</tt></td><td><A HREF="atomic.html" TARGET="_top">Atomic group</A></td></tr> <tr><td><tt class=code>(?=regex)</tt></td><td><A HREF="lookaround.html" TARGET="_top">Positive lookahead</A></td></tr> <tr><td><tt class=code>(?!regex)</tt></td><td><A HREF="lookaround.html" TARGET="_top">Negative lookahead</A></td></tr> <tr><td><tt class=code>(?&lt;=regex)</tt></td><td><a href="lookaround.html#lookbehind">Positive lookbehind</a></td></tr> <tr><td><tt class=code>(?&lt;!regex)</tt></td><td><a href="lookaround.html#lookbehind">Negative lookbehind</a></td></tr> <tr><td><tt class=code>(?(?=regex)then|else)</tt> where <tt class=code>(?=regex)</tt> is any valid lookaround and <tt>then</tt> and <tt>else</tt> are any valid regexes</td><td><A HREF="conditional.html" TARGET="_top">Lookaround conditional</A></td></tr> <tr><td><tt class=code>(?(regex)then|else)</tt> where <tt>regex</tt>, <tt>then</tt>, and <tt>else</tt> are any valid regexes and <tt>regex</tt> is not the name of a capturing group</td><td><A HREF="conditional.html" TARGET="_top">Implicit lookahead conditional</A></td></tr> <tr><td><tt class=code>(?(name)then|else)</tt> where <tt>name</tt> is the name of a capturing group and <tt>then</tt> and <tt>else</tt> are any valid regexes</td><td><A HREF="conditional.html" TARGET="_top">Named conditional</A></td></tr> <tr><td><tt class=code>(?(&lt;name&gt;)then|else)</tt> where <tt>name</tt> is the name of a capturing group and <tt>then</tt> and <tt>else</tt> are any valid regexes</td><td><A HREF="conditional.html" TARGET="_top">Named conditional</A></td></tr> <tr><td><tt class=code>(?(&apos;name&apos;)then|else)</tt> where <tt>name</tt> is the name of a capturing group and <tt>then</tt> and <tt>else</tt> are any valid regexes</td><td><A HREF="conditional.html" TARGET="_top">Named conditional</A></td></tr> <tr><td><tt class=code>(?(1)then|else)</tt> where <tt>1</tt> is the number of a capturing group and <tt>then</tt> and <tt>else</tt> are any valid regexes</td><td><A HREF="conditional.html" TARGET="_top">Conditional</A></td></tr> <tr><td><tt class=code>(?(-1)then|else)</tt> where <tt>-1</tt> is a negative integer and <tt>then</tt> and <tt>else</tt> are any valid regexes</td><td><A HREF="conditional.html" TARGET="_top">Relative conditional</A></td></tr> <tr><td><tt class=code>(?(+1)then|else)</tt> where <tt>+1</tt> is a positive integer and <tt>then</tt> and <tt>else</tt> are any valid regexes</td><td><A HREF="conditional.html" TARGET="_top">Forward conditional</A></td></tr> <tr><td><tt class=code>(?(+1)then|else)</tt> where <tt>1</tt> is the number of a capturing group and <tt>then</tt> and <tt>else</tt> are any valid regexes</td><td><A HREF="conditional.html" TARGET="_top">Conditional</A></td></tr> <tr><td><tt class=code>(?&lt;capture-subtract&gt;regex)</tt> where “capture” and “subtract” are group names and “regex” is any regex</td><td><A HREF="balancing.html" TARGET="_top">Balancing group</A></td></tr> <tr><td><tt class=code>(?&apos;capture-subtract&apos;regex)</tt> where “capture” and “subtract” are group names and “regex” is any regex</td><td><A HREF="balancing.html" TARGET="_top">Balancing group</A></td></tr> <tr><td><tt>(?&name)</tt> where “name” is the name of a capturing group</td><td><A HREF="subroutine.html" TARGET="_top">Named subroutine call</A></td></tr> <tr><td><tt>(?(DEFINE)regex)</tt> where “regex” is any regex</td><td><a href="subroutine.html#define">Subroutine definitions</a></td></tr> <tr><td><tt>(?P&lt;name&gt;regex)</tt></td><td><A HREF="named.html" TARGET="_top">Named capturing group</A></td></tr> <tr><td><tt>(?P=name)</tt></td><td><A HREF="named.html" TARGET="_top">Named backreference</A></td></tr> <tr><td><tt>(?P=1)</tt> through <tt>(?P=99)</tt></td><td><A HREF="backref.html" TARGET="_top">Backreference</A></td></tr> <tr><td><tt>(?P&gt;name)</tt> where “name” is the name of a capturing group</td><td><A HREF="subroutine.html" TARGET="_top">Named subroutine call</A></td></tr> <tr><td><tt>(?R)</tt></td><td><A HREF="recurse.html" TARGET="_top">Recursion</A></td></tr> <tr><td><tt>(?0)</tt></td><td><A HREF="recurse.html" TARGET="_top">Recursion</A></td></tr> <tr><td><tt>(?1)</tt> where 1 is the number of a capturing group</td><td><A HREF="subroutine.html" TARGET="_top">Subroutine call</A></td></tr> <tr><td><tt>(?-1)</tt> where -1 is a negative integer</td><td><A HREF="subroutine.html" TARGET="_top">Relative subroutine call</A></td></tr> <tr><td><tt>(?+1)</tt> where +1 is a positive integer</td><td><A HREF="subroutine.html" TARGET="_top">Forward subroutine call</A></td></tr> </table> <br> <table class=reference> <tr><th>Character Class Syntax</th><th>Feature</th></tr> <tr><td>Any character except <nobr><tt>^-]\</tt></nobr></td><td><A HREF="charclass.html" TARGET="_top">Literal character</A></td></tr> <tr><td><tt>\</tt> (backslash) followed by any of <nobr><tt>^-]\</tt></nobr></td><td><a href="charclass.html#special">Backslash escapes a metacharacter</a></td></tr> <tr><td><tt>\</tt></td><td><a href="charclass.html#special">Literal backslash</a></td></tr> <tr><td><tt>-</tt> between two tokens that each specify a single character</td><td><A HREF="charclass.html" TARGET="_top">Range</A></td></tr> <tr><td><tt>^</tt> immediately after the opening <tt>[</tt></td><td><a href="charclass.html#negated">Negated character class</a></td></tr> <tr><td><tt>[</tt></td><td><a href="charclass.html#special">Literal opening bracket</a></td></tr> <tr><td><tt>[</tt></td><td><A HREF="charclass.html" TARGET="_top">Nested character class</A></td></tr> <tr><td><tt>[base-[subtract]]</tt></td><td><A HREF="charclasssubtract.html" TARGET="_top">Character class subtraction</A></td></tr> <tr><td><tt>[base&&[intersect]]</tt></td><td><A HREF="charclassintersect.html" TARGET="_top">Character class intersection</A></td></tr> <tr><td><tt>[base&&intersect]</tt></td><td><A HREF="charclassintersect.html" TARGET="_top">Character class intersection</A></td></tr> <tr><td><tt>[:alpha:]</tt></td><td><a href="posixbrackets.html#class">POSIX class</a></td></tr> <tr><td><tt>[:^alpha:]</tt></td><td><a href="posixbrackets.html#class">Negated POSIX class</a></td></tr> <tr><td><tt>\p{Alpha}</tt></td><td><a href="posixbrackets.html#class">POSIX class</a></td></tr> <tr><td><tt>\p{IsAlpha}</tt></td><td><a href="posixbrackets.html#class">POSIX class</a></td></tr> <tr><td><tt>[.span-ll.]</tt></td><td><a href="posixbrackets.html#seq">POSIX collation sequence</a></td></tr> <tr><td><tt>[=x=]</tt></td><td><a href="posixbrackets.html#coll">POSIX character equivalence</a></td></tr> </table><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='reference.html'>Introduction</a>&ensp;|&ensp;<a href='refflavors.html'>Table of Contents</a>&ensp;|&ensp;<a href='refquick.html'>Quick Reference</a>&ensp;|&ensp;<a href='refcharacters.html'>Characters</a>&ensp;|&ensp;<a href='refbasic.html'>Basic Features</a>&ensp;|&ensp;<a href='refcharclass.html'>Character Classes</a>&ensp;|&ensp;<a href='refshorthand.html'>Shorthands</a>&ensp;|&ensp;<a href='refanchors.html'>Anchors</a>&ensp;|&ensp;<a href='refwordboundaries.html'>Word Boundaries</a>&ensp;|&ensp;<a href='refrepeat.html'>Quantifiers</a>&ensp;|&ensp;<a href='refunicode.html'>Unicode</a>&ensp;|&ensp;<a href='refcapture.html'>Capturing Groups &amp; Backreferences</a>&ensp;|&ensp;<a href='refext.html'>Named Groups &amp; Backreferences</a>&ensp;|&ensp;<a href='refadv.html'>Special Groups</a>&ensp;|&ensp;<a href='refmodifiers.html'>Mode Modifiers</a>&ensp;|&ensp;<a href='refrecurse.html'>Recursion &amp; Balancing Groups</a>&ensp;|</p><p>|&ensp;<a href='refreplacecharacters.html'>Characters</a>&ensp;|&ensp;<a href='refreplacebackref.html'>Matched Text &amp; Backreferences</a>&ensp;|&ensp;<a href='refreplacecase.html'>Context &amp; Case Conversion</a>&ensp;|&ensp;<a href='refreplaceconditional.html'>Conditionals</a>&ensp;|</p></div> <div id=copyright> <P CLASS=copyright>Page URL: <A HREF="https://www.regular-expressions.info/refquick.html" TARGET="_top">https://www.regular-expressions.info/refquick.html</A><BR> Page last updated: 2 July 2024<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