<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://vwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=Regex_Examples</id>
	<title>Regex Examples - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://vwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=Regex_Examples"/>
	<link rel="alternate" type="text/html" href="http://vwiki.co.uk/index.php?title=Regex_Examples&amp;action=history"/>
	<updated>2026-06-03T18:37:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>http://vwiki.co.uk/index.php?title=Regex_Examples&amp;diff=2755&amp;oldid=prev</id>
		<title>Sstrutt: /* Useful/Standard RegEx */ Added CIDR</title>
		<link rel="alternate" type="text/html" href="http://vwiki.co.uk/index.php?title=Regex_Examples&amp;diff=2755&amp;oldid=prev"/>
		<updated>2024-09-27T13:55:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Useful/Standard RegEx: &lt;/span&gt; Added CIDR&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:55, 27 September 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Matches                  !!  Expression&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Matches                  !!  Expression&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &#039;&#039;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;IP &lt;/del&gt;Address&#039;&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &#039;&#039;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;IPv4 &lt;/ins&gt;Address&#039;&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;^&lt;/del&gt;\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\b &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; \b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;)\b &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|-&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| &#039;&#039;&#039;IPv4 Address&#039;&#039;&#039; alternative&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; \b(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\b &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|-&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| &#039;&#039;&#039;IPv4 CIDR Address&#039;&#039;&#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; \b(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([1-9]|1[0-9]|2[0-9]|3[1-2]&lt;/ins&gt;)\b &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;#039;&amp;#039;&amp;#039;Hostname&amp;#039;&amp;#039;&amp;#039; (no domain)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;#039;&amp;#039;&amp;#039;Hostname&amp;#039;&amp;#039;&amp;#039; (no domain)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sstrutt</name></author>
	</entry>
	<entry>
		<id>http://vwiki.co.uk/index.php?title=Regex_Examples&amp;diff=1940&amp;oldid=prev</id>
		<title>Sstrutt: /* Between Parentheses */ Fixed typo</title>
		<link rel="alternate" type="text/html" href="http://vwiki.co.uk/index.php?title=Regex_Examples&amp;diff=1940&amp;oldid=prev"/>
		<updated>2012-05-14T17:23:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Between Parentheses: &lt;/span&gt; Fixed typo&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:23, 14 May 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l40&quot;&gt;Line 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* Matches everything&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* Matches everything&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;lt;code&amp;gt; (?=\]) &amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;lt;code&amp;gt; (?=\]) &amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* Requires that &amp;lt;code&amp;gt; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[ &lt;/del&gt;&amp;lt;/code&amp;gt; immediately follows the match&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#* Requires that &amp;lt;code&amp;gt; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;] &lt;/ins&gt;&amp;lt;/code&amp;gt; immediately follows the match&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== VMHBA LUN ID ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== VMHBA LUN ID ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sstrutt</name></author>
	</entry>
	<entry>
		<id>http://vwiki.co.uk/index.php?title=Regex_Examples&amp;diff=1802&amp;oldid=prev</id>
		<title>Sstrutt: Initial creation - content from Regular Expressions page</title>
		<link rel="alternate" type="text/html" href="http://vwiki.co.uk/index.php?title=Regex_Examples&amp;diff=1802&amp;oldid=prev"/>
		<updated>2012-04-13T13:33:01Z</updated>

		<summary type="html">&lt;p&gt;Initial creation - content from Regular Expressions page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;See the [[Regular Expressions]] page for more detail on syntax.&lt;br /&gt;
&lt;br /&gt;
== Useful/Standard RegEx ==&lt;br /&gt;
{|class=&amp;quot;vwikitable&amp;quot; &lt;br /&gt;
|- &lt;br /&gt;
! Matches                  !!  Expression&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;IP Address&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; ^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\b &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Hostname&amp;#039;&amp;#039;&amp;#039; (no domain)&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; \A(\w|-)+ &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Email address&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Multiple whitespace&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; \b {2,}\b &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Detailed Examples ==&lt;br /&gt;
=== Logfile Name ===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt; \d{4}-[A-Za-z]{3}-Week\d{1}.log &amp;lt;/code&amp;gt; &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Example matches...&lt;br /&gt;
* &amp;lt;code&amp;gt; 2010-Feb-Week4.log &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; 2009-Dec-Week2.log &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; 1234-aBc-Week0.log &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Between Parentheses ===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt; (?&amp;lt;=\[)(.*?)(?=\]) &amp;lt;/code&amp;gt; &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Matches everything between &amp;lt;code&amp;gt; [ &amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt; ]&amp;lt;/code&amp;gt;, so for example...&lt;br /&gt;
* &amp;lt;code&amp;gt; VMFS_SCSI_DS_01 &amp;lt;/code&amp;gt; is matched from &amp;lt;code&amp;gt; [VMFS_SCSI_DS_01] My_VM/MyVM.vmdk &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Its essentially done via three chunks of the regex...&lt;br /&gt;
# &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; (?&amp;lt;=\[) &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Requires that &amp;lt;code&amp;gt; [ &amp;lt;/code&amp;gt; immediately proceeds the match&lt;br /&gt;
# &amp;lt;code&amp;gt; (.*?) &amp;lt;/code&amp;gt;&lt;br /&gt;
#* Matches everything&lt;br /&gt;
# &amp;lt;code&amp;gt; (?=\]) &amp;lt;/code&amp;gt;&lt;br /&gt;
#* Requires that &amp;lt;code&amp;gt; [ &amp;lt;/code&amp;gt; immediately follows the match&lt;br /&gt;
&lt;br /&gt;
=== VMHBA LUN ID ===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt; (?&amp;lt;=:)([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])$ &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finds a number between 0 and 255 immediately after a &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; at the end of a line, specifically intended to get the LUN ID from a VMware canonical path, so for example...&lt;br /&gt;
* &amp;lt;code&amp;gt;13&amp;lt;/code&amp;gt; is matched from &amp;lt;code&amp;gt;vmhba3:0:13&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stepping through the regex...&lt;br /&gt;
# &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt; (?&amp;lt;=:) &amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Requires that &amp;lt;code&amp;gt; : &amp;lt;/code&amp;gt; immediately proceeds the match&lt;br /&gt;
# &amp;lt;code&amp;gt;([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Matches any number between 0 and 255&lt;br /&gt;
# &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Ensures that the proceeding match occurs at the end of a line&lt;br /&gt;
&lt;br /&gt;
=== vRanger Backup text in VM Notes ===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;\s?\bvRanger.*Repository \[.*\]\s?&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Finds the text created by vRanger in a VM&amp;#039;s notes (so you can strip it out)...&lt;br /&gt;
* EG &amp;lt;code&amp;gt;vRanger Pro Backup: Type [Full] Result [Success] Time [27/09/2010 06:46:54] Repository [VC_Server]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stepping through the regex...&lt;br /&gt;
# &amp;lt;code&amp;gt;\s?&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Matches any white-space at the start of the match&lt;br /&gt;
# &amp;lt;code&amp;gt;\bvRanger.*&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Matches &amp;lt;code&amp;gt;vRanger&amp;lt;/code&amp;gt; at the start of a word and anything after until...&lt;br /&gt;
# &amp;lt;code&amp;gt;Repository \[.*\]&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Matches the end of a vRanger text segment, &amp;lt;code&amp;gt;Repository [hostname]&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;\s?&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Matches any white-space at the end of the match&lt;br /&gt;
&lt;br /&gt;
=== Script Version ===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;(?&amp;lt;=v)[0-9]+(\.[0-9]+)+(?=.)&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Gets the script version number off the end of a script name&lt;br /&gt;
* EG Get &amp;lt;code&amp;gt; 1.2.3 &amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;Script-v1.2.3.ps1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Stepping through the regex...&lt;br /&gt;
# &amp;lt;code&amp;gt;(?&amp;lt;=v)&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Requires that &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; immediately precedes the match&lt;br /&gt;
# &amp;lt;code&amp;gt;[0-9]+&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Matches one or more digits&lt;br /&gt;
# &amp;lt;code&amp;gt;(\.[0-9]+)+&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Matches &amp;lt;code&amp;gt;.n&amp;lt;/code&amp;gt; one or more times&lt;br /&gt;
# &amp;lt;code&amp;gt;(?=.)&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Requires that &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt; follows the match&lt;br /&gt;
&lt;br /&gt;
=== Lab Manager VM Prefix ===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;(\b\d{6}-)&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Matches the numeric prefix at the start of a Lab Manager VM name&lt;br /&gt;
* EG Matches &amp;lt;code&amp;gt;002310-&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt; 002310-Server-A-10&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Regex]]&lt;/div&gt;</summary>
		<author><name>Sstrutt</name></author>
	</entry>
</feed>