<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kylir&#039;s Website &#187; Regular Expressions</title>
	<atom:link href="http://www.kylirhorton.com/tag/regular-expressions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kylirhorton.com</link>
	<description></description>
	<lastBuildDate>Sun, 09 Oct 2011 01:58:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A Regular Expression that matches CSS lengths</title>
		<link>http://www.kylirhorton.com/2008/a-regular-expression-that-matches-css-lengths/</link>
		<comments>http://www.kylirhorton.com/2008/a-regular-expression-that-matches-css-lengths/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 19:15:05 +0000</pubDate>
		<dc:creator>Kylir</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Regular Expressions]]></category>

		<guid isPermaLink="false">http://www.kylirhorton.com/?p=11</guid>
		<description><![CDATA[As a followup to my previous post, here&#8217;s a useful regular expression for selecting a valid CSS length. [-+]?[0-9]*\.?[0-9]+(px&#124;ex&#124;em&#124;in&#124;cm&#124;mm&#124;pt&#124;pc&#124;%)]]></description>
			<content:encoded><![CDATA[<p>As a followup to my previous post, here&#8217;s a useful regular expression for selecting a valid CSS length.<br />
<br />
<span id="more-11"></span><br />
<code>[-+]?[0-9]*\.?[0-9]+(px|ex|em|in|cm|mm|pt|pc|%)</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kylirhorton.com/2008/a-regular-expression-that-matches-css-lengths/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Regular Expression that matches CSS colors</title>
		<link>http://www.kylirhorton.com/2008/a-regular-expression-that-matches-css-colors/</link>
		<comments>http://www.kylirhorton.com/2008/a-regular-expression-that-matches-css-colors/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 04:12:11 +0000</pubDate>
		<dc:creator>Kylir</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Regular Expressions]]></category>

		<guid isPermaLink="false">http://www.kylirhorton.com/?p=10</guid>
		<description><![CDATA[Recently I needed to have a Regular Expression which would match valid CSS colors. I wasn&#8217;t able to find any after searching the Internets for a while, so I wrote my own. (#([0-9A-Fa-f]{3,6})\b)&#124; (aqua)&#124;(black)&#124;(blue)&#124;(fuchsia)&#124; (gray)&#124;(green)&#124;(lime)&#124;(maroon)&#124; (navy)&#124;(olive)&#124;(orange)&#124;(purple)&#124; (red)&#124;(silver)&#124;(teal)&#124;(white)&#124;(yellow)&#124; (rgb\(\s*\b([0-9]&#124;[1-9][0-9]&#124;1[0-9][0-9]&#124;2[0-4][0-9]&#124;25[0-5])\b\s*, \s*\b([0-9]&#124;[1-9][0-9]&#124;1[0-9][0-9]&#124;2[0-4][0-9]&#124;25[0-5])\b\s*, \s*\b([0-9]&#124;[1-9][0-9]&#124;1[0-9][0-9]&#124;2[0-4][0-9]&#124;25[0-5])\b\s*\))&#124; (rgb\(\s*(\d?\d%&#124;100%)+\s*,\s*(\d?\d%&#124;100%)+\s*,\s*(\d?\d%&#124;100%)+\s*\)) Just as a recap, a valid CSS color can be represented as a&#8230; named [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to have a Regular Expression which would match valid CSS colors. I wasn&#8217;t able to find any after searching the Internets for a while, so I wrote my own.</p>
<p><span id="more-10"></span></p>
<p><code>(#([0-9A-Fa-f]{3,6})\b)|</code></p>
<p><code>(aqua)|(black)|(blue)|(fuchsia)|</code></p>
<p><code>(gray)|(green)|(lime)|(maroon)|</code></p>
<p><code>(navy)|(olive)|(orange)|(purple)|</code></p>
<p><code>(red)|(silver)|(teal)|(white)|(yellow)|</code></p>
<p><code>(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,</code></p>
<p><code>\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,</code></p>
<p><code>\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|</code></p>
<p><code>(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\))</code></p>
<p>Just as a recap, a valid CSS color can be represented as a&#8230;</p>
<ol>
<li>named color, such as &#8220;red&#8221;, &#8220;green&#8221;, &#8220;blue&#8221;, &#8220;black&#8221;, etc.</li>
<li>hexadecimal value, such as #ff0000 (red), #00ff00 (green), #0000ff (blue), #000000 (black), etc. Some hexadecimal values can be reduced to just three characters. For example, red is #f00 and green is #0f0.</li>
<li>triplet consisting of the color&#8217;s RGB values, such as rgb(255,0,0) for red and rgb(0,255,0) for green.</li>
</ol>
<p>The Regular Expression listed above should be able to handle any of the variants that a CSS color can throw at it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kylirhorton.com/2008/a-regular-expression-that-matches-css-colors/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

