<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.6bit.ch/index.php?action=history&amp;feed=atom&amp;title=Regular_Expressions</id>
	<title>Regular Expressions - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.6bit.ch/index.php?action=history&amp;feed=atom&amp;title=Regular_Expressions"/>
	<link rel="alternate" type="text/html" href="http://wiki.6bit.ch/index.php?title=Regular_Expressions&amp;action=history"/>
	<updated>2026-05-10T13:06:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.6bit.ch/index.php?title=Regular_Expressions&amp;diff=20&amp;oldid=prev</id>
		<title>Xbl: Xbl moved page Regex to Regular Expressions without leaving a redirect</title>
		<link rel="alternate" type="text/html" href="http://wiki.6bit.ch/index.php?title=Regular_Expressions&amp;diff=20&amp;oldid=prev"/>
		<updated>2022-03-16T10:35:07Z</updated>

		<summary type="html">&lt;p&gt;Xbl moved page &lt;a href=&quot;/index.php?title=Regex&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Regex (page does not exist)&quot;&gt;Regex&lt;/a&gt; to &lt;a href=&quot;/index.php?title=Regular_Expressions&quot; title=&quot;Regular Expressions&quot;&gt;Regular Expressions&lt;/a&gt; without leaving a redirect&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:35, 16 March 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Xbl</name></author>
	</entry>
	<entry>
		<id>http://wiki.6bit.ch/index.php?title=Regular_Expressions&amp;diff=8&amp;oldid=prev</id>
		<title>Xbl: Created page with &quot;== Regular Expressions ==  {| class=&quot;wikitable&quot; |- ! Metacharacter ! Description |- valign=&quot;top&quot; !&lt;code&gt;\&lt;/code&gt; |Escape character. |- |- valign=&quot;top&quot; !&lt;code&gt;?&lt;/code&gt; |Matches the preceding element zero or one time. For example, &lt;code&gt;ab?c&lt;/code&gt; matches only &quot;ac&quot; or &quot;abc&quot;. |- !&lt;code&gt;+&lt;/code&gt; |Matches the preceding element one or more times. For example, &lt;code&gt;ab+c&lt;/code&gt; matches &quot;abc&quot;, &quot;abbc&quot;, &quot;abbbc&quot;, and so on, but not &quot;ac&quot;. |- !&lt;code&gt;&lt;nowiki&gt;|&lt;/nowiki&gt;&lt;/code&gt; |The ch...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.6bit.ch/index.php?title=Regular_Expressions&amp;diff=8&amp;oldid=prev"/>
		<updated>2022-02-25T12:24:58Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Regular Expressions ==  {| class=&amp;quot;wikitable&amp;quot; |- ! Metacharacter ! Description |- valign=&amp;quot;top&amp;quot; !&amp;lt;code&amp;gt;\&amp;lt;/code&amp;gt; |Escape character. |- |- valign=&amp;quot;top&amp;quot; !&amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; |Matches the preceding element zero or one time. For example, &amp;lt;code&amp;gt;ab?c&amp;lt;/code&amp;gt; matches only &amp;quot;ac&amp;quot; or &amp;quot;abc&amp;quot;. |- !&amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; |Matches the preceding element one or more times. For example, &amp;lt;code&amp;gt;ab+c&amp;lt;/code&amp;gt; matches &amp;quot;abc&amp;quot;, &amp;quot;abbc&amp;quot;, &amp;quot;abbbc&amp;quot;, and so on, but not &amp;quot;ac&amp;quot;. |- !&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; |The ch...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Regular Expressions ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Metacharacter&lt;br /&gt;
! Description&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
!&amp;lt;code&amp;gt;\&amp;lt;/code&amp;gt;&lt;br /&gt;
|Escape character.&lt;br /&gt;
|-&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
!&amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt;&lt;br /&gt;
|Matches the preceding element zero or one time. For example, &amp;lt;code&amp;gt;ab?c&amp;lt;/code&amp;gt; matches only &amp;quot;ac&amp;quot; or &amp;quot;abc&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
!&amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;&lt;br /&gt;
|Matches the preceding element one or more times. For example, &amp;lt;code&amp;gt;ab+c&amp;lt;/code&amp;gt; matches &amp;quot;abc&amp;quot;, &amp;quot;abbc&amp;quot;, &amp;quot;abbbc&amp;quot;, and so on, but not &amp;quot;ac&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
!&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|The choice (also known as alternation or set union) operator matches either the expression before or the expression after the operator. For example, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;abc|def&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; matches &amp;quot;abc&amp;quot; or &amp;quot;def&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
!&amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt;&lt;br /&gt;
|Matches the preceding element zero or more times. For example, &amp;lt;code&amp;gt;ab*c&amp;lt;/code&amp;gt; matches &amp;quot;ac&amp;quot;, &amp;quot;abc&amp;quot;, &amp;quot;abbbc&amp;quot;, etc. &amp;lt;code&amp;gt;[xyz]*&amp;lt;/code&amp;gt; matches &amp;quot;&amp;quot;, &amp;quot;x&amp;quot;, &amp;quot;y&amp;quot;, &amp;quot;z&amp;quot;, &amp;quot;zx&amp;quot;, &amp;quot;zyx&amp;quot;, &amp;quot;xyzzy&amp;quot;, and so on. &amp;lt;code&amp;gt;(ab)*&amp;lt;/code&amp;gt; matches &amp;quot;&amp;quot;, &amp;quot;ab&amp;quot;, &amp;quot;abab&amp;quot;, &amp;quot;ababab&amp;quot;, and so on.&lt;br /&gt;
|-&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
!&amp;lt;code&amp;gt;^&amp;lt;/code&amp;gt;&lt;br /&gt;
|Matches the starting position within the string. In line-based tools, it matches the starting position of any line.&lt;br /&gt;
|-&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
!&amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&lt;br /&gt;
|Matches any single character (many applications exclude [[newline]]s, and exactly which characters are considered newlines is flavor-, character-encoding-, and platform-specific, but it is safe to assume that the line feed character is included). Within POSIX bracket expressions, the dot character matches a literal dot. For example, &amp;lt;code&amp;gt;a.c&amp;lt;/code&amp;gt; matches &amp;quot;abc&amp;quot;, etc., but &amp;lt;code&amp;gt;[a.c]&amp;lt;/code&amp;gt; matches only &amp;quot;a&amp;quot;, &amp;quot;.&amp;quot;, or &amp;quot;c&amp;quot;.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
!&amp;lt;code&amp;gt;[&amp;amp;nbsp;]&amp;lt;/code&amp;gt;&lt;br /&gt;
|A bracket expression. Matches a single character that is contained within the brackets. For example, &amp;lt;code&amp;gt;[abc]&amp;lt;/code&amp;gt; matches &amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;, or &amp;quot;c&amp;quot;. &amp;lt;code&amp;gt;[a-z]&amp;lt;/code&amp;gt; specifies a range which matches any lowercase letter from &amp;quot;a&amp;quot; to &amp;quot;z&amp;quot;. These forms can be mixed: &amp;lt;code&amp;gt;[abcx-z]&amp;lt;/code&amp;gt; matches &amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;, &amp;quot;c&amp;quot;, &amp;quot;x&amp;quot;, &amp;quot;y&amp;quot;, or &amp;quot;z&amp;quot;, as does &amp;lt;code&amp;gt;[a-cx-z]&amp;lt;/code&amp;gt;.&lt;br /&gt;
The &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt; character is treated as a literal character if it is the last or the first (after the &amp;lt;code&amp;gt;^&amp;lt;/code&amp;gt;, if present) character within the brackets: &amp;lt;code&amp;gt;[abc-]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[-abc]&amp;lt;/code&amp;gt;. Note that backslash escapes are not allowed. The &amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; character can be included in a bracket expression if it is the first (after the &amp;lt;code&amp;gt;^&amp;lt;/code&amp;gt;) character: &amp;lt;code&amp;gt;[]abc]&amp;lt;/code&amp;gt;.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
!&amp;lt;code&amp;gt;[^&amp;amp;nbsp;]&amp;lt;/code&amp;gt;&lt;br /&gt;
|Matches a single character that is not contained within the brackets. For example, &amp;lt;code&amp;gt;[^abc]&amp;lt;/code&amp;gt; matches any character other than &amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;, or &amp;quot;c&amp;quot;. &amp;lt;code&amp;gt;[^a-z]&amp;lt;/code&amp;gt; matches any single character that is not a lowercase letter from &amp;quot;a&amp;quot; to &amp;quot;z&amp;quot;. Likewise, literal characters and ranges can be mixed.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
!&amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt;&lt;br /&gt;
|Matches the ending position of the string or the position just before a string-ending newline. In line-based tools, it matches the ending position of any line.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
!&amp;lt;code&amp;gt;( )&amp;lt;/code&amp;gt;&lt;br /&gt;
|Defines a marked subexpression. The string matched within the parentheses can be recalled later (see the next entry, &amp;lt;code&amp;gt;\''n''&amp;lt;/code&amp;gt;). A marked subexpression is also called a block or capturing group. '''BRE mode requires &amp;lt;code&amp;gt;\(&amp;amp;nbsp;\)&amp;lt;/code&amp;gt;'''.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
!&amp;lt;code&amp;gt;\''n''&amp;lt;/code&amp;gt;&lt;br /&gt;
|Matches what the ''n''th marked subexpression matched, where ''n'' is a digit from 1 to 9. This construct is vaguely defined in the POSIX.2 standard. Some tools allow referencing more than nine capturing groups. Also known as a backreference. '''backreferences are only supported in BRE mode'''&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
!&amp;lt;code&amp;gt;{''m'',''n''}&amp;lt;/code&amp;gt;&lt;br /&gt;
|Matches the preceding element at least ''m'' and not more than ''n'' times. For example, &amp;lt;code&amp;gt;a{3,5}&amp;lt;/code&amp;gt; matches only &amp;quot;aaa&amp;quot;, &amp;quot;aaaa&amp;quot;, and &amp;quot;aaaaa&amp;quot;. This is not found in a few older instances of regexes. '''BRE mode requires &amp;lt;code&amp;gt;\{''m'',''n''\}&amp;lt;/code&amp;gt;'''.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Examples:'''&lt;br /&gt;
* &amp;lt;code&amp;gt;[hc]?at&amp;lt;/code&amp;gt; matches &amp;quot;at&amp;quot;, &amp;quot;hat&amp;quot;, and &amp;quot;cat&amp;quot;.&lt;br /&gt;
* &amp;lt;code&amp;gt;[hc]*at&amp;lt;/code&amp;gt; matches &amp;quot;at&amp;quot;, &amp;quot;hat&amp;quot;, &amp;quot;cat&amp;quot;, &amp;quot;hhat&amp;quot;, &amp;quot;chat&amp;quot;, &amp;quot;hcat&amp;quot;, &amp;quot;cchchat&amp;quot;, and so on.&lt;br /&gt;
* &amp;lt;code&amp;gt;[hc]+at&amp;lt;/code&amp;gt; matches &amp;quot;hat&amp;quot;, &amp;quot;cat&amp;quot;, &amp;quot;hhat&amp;quot;, &amp;quot;chat&amp;quot;, &amp;quot;hcat&amp;quot;, &amp;quot;cchchat&amp;quot;, and so on, but not &amp;quot;at&amp;quot;.&lt;br /&gt;
* &amp;lt;code&amp;gt;cat|dog&amp;lt;/code&amp;gt; matches &amp;quot;cat&amp;quot; or &amp;quot;dog&amp;quot;.&lt;br /&gt;
* &amp;lt;code&amp;gt;.at&amp;lt;/code&amp;gt; matches any three-character string ending with &amp;quot;at&amp;quot;, including &amp;quot;hat&amp;quot;, &amp;quot;cat&amp;quot;, &amp;quot;bat&amp;quot;, &amp;quot;4at&amp;quot;, &amp;quot;#at&amp;quot; and &amp;quot; at&amp;quot; (starting with a space).&lt;br /&gt;
* &amp;lt;code&amp;gt;[hc]at&amp;lt;/code&amp;gt; matches &amp;quot;hat&amp;quot; and &amp;quot;cat&amp;quot;.&lt;br /&gt;
* &amp;lt;code&amp;gt;[^b]at&amp;lt;/code&amp;gt; matches all strings matched by &amp;lt;code&amp;gt;.at&amp;lt;/code&amp;gt; except &amp;quot;bat&amp;quot;.&lt;br /&gt;
* &amp;lt;code&amp;gt;[^hc]at&amp;lt;/code&amp;gt; matches all strings matched by &amp;lt;code&amp;gt;.at&amp;lt;/code&amp;gt; other than &amp;quot;hat&amp;quot; and &amp;quot;cat&amp;quot;.&lt;br /&gt;
* &amp;lt;code&amp;gt;^[hc]at&amp;lt;/code&amp;gt; matches &amp;quot;hat&amp;quot; and &amp;quot;cat&amp;quot;, but only at the beginning of the string or line.&lt;br /&gt;
* &amp;lt;code&amp;gt;[hc]at$&amp;lt;/code&amp;gt; matches &amp;quot;hat&amp;quot; and &amp;quot;cat&amp;quot;, but only at the end of the string or line.&lt;br /&gt;
* &amp;lt;code&amp;gt;\[.\]&amp;lt;/code&amp;gt; matches any single character surrounded by &amp;quot;[&amp;quot; and &amp;quot;]&amp;quot; since the brackets are escaped, for example: &amp;quot;[a]&amp;quot;, &amp;quot;[b]&amp;quot;, &amp;quot;[7]&amp;quot;, &amp;quot;[@]&amp;quot;, &amp;quot;[]]&amp;quot;, and &amp;quot;[ ]&amp;quot; (bracket space bracket).&lt;br /&gt;
* &amp;lt;code&amp;gt;s.*&amp;lt;/code&amp;gt; matches s followed by zero or more characters, for example: &amp;quot;s&amp;quot;, &amp;quot;saw&amp;quot;, &amp;quot;seed&amp;quot;, &amp;quot;s3w96.7&amp;quot;, and &amp;quot;s6#h%(&amp;gt;&amp;gt;&amp;gt;m n mQ&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Xbl</name></author>
	</entry>
</feed>