<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://beardedmaker.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Regular_expression</id>
		<title>Regular expression - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://beardedmaker.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Regular_expression"/>
		<link rel="alternate" type="text/html" href="https://beardedmaker.com/wiki/index.php?title=Regular_expression&amp;action=history"/>
		<updated>2026-04-26T17:44:55Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.4</generator>

	<entry>
		<id>https://beardedmaker.com/wiki/index.php?title=Regular_expression&amp;diff=166&amp;oldid=prev</id>
		<title>Beard: Created page with &quot;&lt;pre&gt; [\^$.|?*+() need to be escaped with \ OR - 'gr[ae]y' will match 'gray' OR 'gray' OR - 'cat|dog' matches patterns 'cat' or 'dog' RANGE - [0-9] to match the range. [0-9a-f...&quot;</title>
		<link rel="alternate" type="text/html" href="https://beardedmaker.com/wiki/index.php?title=Regular_expression&amp;diff=166&amp;oldid=prev"/>
				<updated>2016-02-29T21:46:09Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; [\^$.|?*+() need to be escaped with \ OR - &amp;#039;gr[ae]y&amp;#039; will match &amp;#039;gray&amp;#039; OR &amp;#039;gray&amp;#039; OR - &amp;#039;cat|dog&amp;#039; matches patterns &amp;#039;cat&amp;#039; or &amp;#039;dog&amp;#039; RANGE - [0-9] to match the range. [0-9a-f...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
[\^$.|?*+() need to be escaped with \&lt;br /&gt;
OR - 'gr[ae]y' will match 'gray' OR 'gray'&lt;br /&gt;
OR - 'cat|dog' matches patterns 'cat' or 'dog'&lt;br /&gt;
RANGE - [0-9] to match the range. [0-9a-fA-FxX] matches 0-9, a-f, A-F, x, or X.&lt;br /&gt;
NEGATE - [^x] does not match x.&lt;br /&gt;
ANCHOR - ^ at beginning of string and $ at end of string. ^b only matches the first b in bob.&lt;br /&gt;
OPTIONAL - 'colou?r' makes the u optional, thus matching 'colour' or 'color'&lt;br /&gt;
REPETITION - [0-9]+ match once or more times, [0-9]* match zero or more times&lt;br /&gt;
\b - word boundary. characterized as a word character next to a non word character.&lt;br /&gt;
\d - matches digit character&lt;br /&gt;
\D - matches non digits character&lt;br /&gt;
\w - matches word character (alphanumeric)&lt;br /&gt;
\W - matches non word character (alphanumeric)&lt;br /&gt;
\s - matches whitespace character&lt;br /&gt;
\S - matches non whitespace character&lt;br /&gt;
. - dot matches single character. 'gr.y' &lt;br /&gt;
* - matches 0 or more.&lt;br /&gt;
? - matches 0 or 1&lt;br /&gt;
+ - matches 1 or more of previous character. 'er+or' will match 'eror' OR 'error' and so on&lt;br /&gt;
.* - used like *&lt;br /&gt;
[abc] - match 1 character which is a, b, or c&lt;br /&gt;
[^abc] - NOT match 1 character which is a, b, or c&lt;br /&gt;
{} - match specified number of previous character. 'er{1,2}or' matches 'eror' or 'error' only&lt;br /&gt;
^ - match following set of characters (word) only if they are the first on a line. ^error&lt;br /&gt;
$ - matches if previous characters are last on a line. error$&lt;br /&gt;
() - groups things together. example\.(com|org) matches .com or .org&lt;br /&gt;
&lt;br /&gt;
(?=x) - &amp;quot;lookahead&amp;quot; to look for a character (x), but don't match it&lt;br /&gt;
(?!x) - negated &amp;quot;lookahead&amp;quot;&lt;br /&gt;
&lt;br /&gt;
\t - tab&lt;br /&gt;
\r - carriage return&lt;br /&gt;
\n - line feed&lt;br /&gt;
\a - bell&lt;br /&gt;
\e - escape&lt;br /&gt;
\f - form feed&lt;br /&gt;
\v - vertical tab&lt;br /&gt;
\xFF - hexadecimal&lt;br /&gt;
\uFFFF - unicode&lt;br /&gt;
&lt;br /&gt;
windows text files use \r\n, unix uses \n&lt;br /&gt;
&lt;br /&gt;
EXAMPLES (work with sed):&lt;br /&gt;
&lt;br /&gt;
	Remove all leading whitespaces = s/^[ \t]*//&lt;br /&gt;
	Remove all trailing whitespaces = s/[ \t]*$//&lt;br /&gt;
	Remove all HTML/XML tags = s/&amp;lt;[^&amp;gt;]\+&amp;gt;//g&lt;br /&gt;
	Replace &amp;amp;amp; with &amp;amp; = s/&amp;amp;amp;/\&amp;amp;/g&lt;br /&gt;
	Replace &amp;amp;#39; with ' = s/\&amp;amp;#39;/'/g&lt;br /&gt;
	Escape all special characters - sed -e 's/[\/&amp;amp;]/\\&amp;amp;/g'&lt;br /&gt;
&lt;br /&gt;
EXAMPLES (work with grep -P):&lt;br /&gt;
	&lt;br /&gt;
	Search for strings between tags on single line = &amp;lt;td&amp;gt;(.*?)&amp;lt;\/td&amp;gt;&lt;br /&gt;
	Phone Number = [0-9 \(\)\.\-]*?&lt;br /&gt;
	[^\x00-\x7F] - matches non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
MORE EXAMPLES:&lt;br /&gt;
&lt;br /&gt;
	href=\&amp;quot;(?!/|#) - find relative path names in HTML links&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Beard</name></author>	</entry>

	</feed>