<?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: PHP function that strips all non alphanumeric characters</title>
	<atom:link href="http://www.crainbandy.com/programming/php-function-that-strips-all-non-alphanumeric-characters/feed" rel="self" type="application/rss+xml" />
	<link>http://www.crainbandy.com/programming/php-function-that-strips-all-non-alphanumeric-characters</link>
	<description>For Web Developers</description>
	<lastBuildDate>Tue, 22 Mar 2011 21:00:52 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Garrett</title>
		<link>http://www.crainbandy.com/programming/php-function-that-strips-all-non-alphanumeric-characters/comment-page-1#comment-2291</link>
		<dc:creator>Garrett</dc:creator>
		<pubDate>Wed, 09 Dec 2009 15:14:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.crainbandy.com/?p=873#comment-2291</guid>
		<description>Any idea which is faster?

preg_replace(&#039;#[^a-z0-9]#i&#039;, &#039;&#039;, $string)


or


preg_replace(&#039;#[^a-z0-9A-Z]#&#039;, &#039;&#039;, $string)


or do they compile down to the same regex and are equivalent?


Any slight improvement would make a huge difference in my script, as I&#039;m running around 100 million replaces total.</description>
		<content:encoded><![CDATA[<p>Any idea which is faster?</p>
<p>preg_replace(&#8217;#[^a-z0-9]#i&#8217;, &#8221;, $string)</p>
<p>or</p>
<p>preg_replace(&#8217;#[^a-z0-9A-Z]#&#8217;, &#8221;, $string)</p>
<p>or do they compile down to the same regex and are equivalent?</p>
<p>Any slight improvement would make a huge difference in my script, as I&#8217;m running around 100 million replaces total.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carsten</title>
		<link>http://www.crainbandy.com/programming/php-function-that-strips-all-non-alphanumeric-characters/comment-page-1#comment-2253</link>
		<dc:creator>Carsten</dc:creator>
		<pubDate>Wed, 07 Oct 2009 19:54:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.crainbandy.com/?p=873#comment-2253</guid>
		<description>\w and \W depend on the locale being used. This means that, for instance, with a German locale setting the code above will not remove ä ö ü Ä Ö Ü ß
Apart from that, \w always includes the underscore, which is not an alphanumeric.

preg_replace(&#039;#[^a-z0-9]#i&#039;, &#039;&#039;, $string) will do the job.</description>
		<content:encoded><![CDATA[<p>\w and \W depend on the locale being used. This means that, for instance, with a German locale setting the code above will not remove ä ö ü Ä Ö Ü ß<br />
Apart from that, \w always includes the underscore, which is not an alphanumeric.</p>
<p>preg_replace(&#8217;#[^a-z0-9]#i&#8217;, &#8221;, $string) will do the job.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

