<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: CSS Declaration Grabber Regular Expression</title>
	<atom:link href="http://borkweb.com/story/css-declaration-grabber-regular-expression/feed" rel="self" type="application/rss+xml" />
	<link>http://borkweb.com/story/css-declaration-grabber-regular-expression</link>
	<description>Some People Are Squirrel Handed.</description>
	<lastBuildDate>Thu, 12 Jan 2012 15:56:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Zesposi</title>
		<link>http://borkweb.com/story/css-declaration-grabber-regular-expression/comment-page-1#comment-43803</link>
		<dc:creator>Zesposi</dc:creator>
		<pubDate>Sat, 12 Jun 2010 21:01:58 +0000</pubDate>
		<guid isPermaLink="false">http://borkweb.com/story/css-declaration-grabber-regular-expression#comment-43803</guid>
		<description>Thanks Matt, just what I was looking for.</description>
		<content:encoded><![CDATA[<p>Thanks Matt, just what I was looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sinan Özel</title>
		<link>http://borkweb.com/story/css-declaration-grabber-regular-expression/comment-page-1#comment-41280</link>
		<dc:creator>Sinan Özel</dc:creator>
		<pubDate>Wed, 27 Aug 2008 10:19:01 +0000</pubDate>
		<guid isPermaLink="false">http://borkweb.com/story/css-declaration-grabber-regular-expression#comment-41280</guid>
		<description>The $iLimit and $jLimit lines are there for debugging, so you&#039;ll want to remove them, or increase the 10 to 10 000 as a precaution.</description>
		<content:encoded><![CDATA[<p>The $iLimit and $jLimit lines are there for debugging, so you&#8217;ll want to remove them, or increase the 10 to 10 000 as a precaution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sinan Özel</title>
		<link>http://borkweb.com/story/css-declaration-grabber-regular-expression/comment-page-1#comment-41279</link>
		<dc:creator>Sinan Özel</dc:creator>
		<pubDate>Wed, 27 Aug 2008 10:17:54 +0000</pubDate>
		<guid isPermaLink="false">http://borkweb.com/story/css-declaration-grabber-regular-expression#comment-41279</guid>
		<description>The following is the PHP code I used to create an array out of CSS declarations, including the regular expressions. I hope it is helpful.

Sinan Özel


&lt;code&gt;
			while( preg_match( &#039;/(?ims)([a-z0-9\s\.\:#_\-@]+)\{([^\}]*)\}/&#039;, $css, $arr ) ){
				$iLimit++;if( $iLimit &gt; 10 ) break;
				$arrSelectors[trim($arr[1])] = trim($arr[2]);
				$css = str_replace( $arr[0], &#039;&#039;, $css );
			}
			if( sizeof( $arrSelectors ) ){
				foreach( $arrSelectors as $selector=&gt;$declaration ){
					unset( $arrSelectors[$selector] );
					while( preg_match( &#039;/(?ims)([a-z0-9\s\.\:#_\-@]+)\:([^;]*)\;{0,1}/&#039;, $declaration, $arr ) ){
						$jLimit++;if( $jLimit &gt; 10 ) break;
						$arrSelectors[$selector][trim($arr[1])] = trim( $arr[2] );
						$declaration = str_replace( $arr[0], &#039;&#039;, $declaration );
					}
				}
			}

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>The following is the PHP code I used to create an array out of CSS declarations, including the regular expressions. I hope it is helpful.</p>
<p>Sinan Özel</p>
<p><code><br />
			while( preg_match( '/(?ims)([a-z0-9\s\.\:#_\-@]+)\{([^\}]*)\}/', $css, $arr ) ){<br />
				$iLimit++;if( $iLimit &gt; 10 ) break;<br />
				$arrSelectors[trim($arr[1])] = trim($arr[2]);<br />
				$css = str_replace( $arr[0], '', $css );<br />
			}<br />
			if( sizeof( $arrSelectors ) ){<br />
				foreach( $arrSelectors as $selector=&gt;$declaration ){<br />
					unset( $arrSelectors[$selector] );<br />
					while( preg_match( '/(?ims)([a-z0-9\s\.\:#_\-@]+)\:([^;]*)\;{0,1}/', $declaration, $arr ) ){<br />
						$jLimit++;if( $jLimit &gt; 10 ) break;<br />
						$arrSelectors[$selector][trim($arr[1])] = trim( $arr[2] );<br />
						$declaration = str_replace( $arr[0], '', $declaration );<br />
					}<br />
				}<br />
			}</p>
<p></code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

