<?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/"
xmlns:series="http://unfoldingneurons.com/"
> <channel><title>Comments on: Assign Anchor IDs Using MooTools&#160;1.2</title> <atom:link href="http://davidwalsh.name/assign-anchor-ids-mootools/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name/assign-anchor-ids-mootools</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Mon, 21 May 2012 07:46:19 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: Trouts</title><link>http://davidwalsh.name/assign-anchor-ids-mootools#comment-1852</link> <dc:creator>Trouts</dc:creator> <pubDate>Mon, 23 Jun 2008 22:45:16 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=228#comment-1852</guid> <description>An easier way:
If your HTML code is already standards compliant, just filter your string like this:function anchors_demand_ids($str){
return preg_replace(&#039;#&lt;a (?![^&gt;]*id *= *&quot;)(.*?)name=&quot;(.*?)&quot;(?![^&gt;]*id *= *&quot;)(.*?)&gt;#&#039;, &#039;&lt;a \\1id=&quot;\\2&quot; name=&quot;\\2&quot;\\3\\4&gt;&#039;, $str);
}i&#8217;ve quickly tested it with:$big_str=&#8217;
&lt;a href=&quot;sadasd&quot; name=&quot;1&quot; rel=&quot;1&quot;&gt;sadasd&lt;/a&gt;&lt;a href=&quot;sadasd&quot; id=&quot;2&quot; name=&quot;2&quot; rel=&quot;2&quot;&gt;sadasd&lt;/a&gt;&lt;a href=&quot;sadasd&quot; name=&quot;3&quot; rel=&quot;3&quot;&gt;sadasd&lt;/a&gt;&lt;a href=&quot;sadasd&quot; name=&quot;2&quot; rel=&quot;2&quot; id=&quot;2&quot;&gt;sadasd&lt;/a&gt;
&#8216;;
print anchors_demand_ids($big_str);seems to be fine :)PS: please delete my previous comment as it has no html chars.</description> <content:encoded><![CDATA[<p>An easier way:<br
/> If your HTML code is already standards compliant, just filter your string like this:</p><p>function anchors_demand_ids($str){<br
/> return preg_replace(&#x27;#&lt;a (?![^&gt;]*id *= *&quot;)(.*?)name=&quot;(.*?)&quot;(?![^&gt;]*id *= *&quot;)(.*?)&gt;#&#x27;, &#x27;&lt;a \\1id=&quot;\\2&quot; name=&quot;\\2&quot;\\3\\4&gt;&#x27;, $str);<br
/> }</p><p>i&rsquo;ve quickly tested it with:</p><p>$big_str=&rsquo;<br
/> &lt;a href=&quot;sadasd&quot; name=&quot;1&quot; rel=&quot;1&quot;&gt;sadasd&lt;/a&gt;</p><p>&lt;a href=&quot;sadasd&quot; id=&quot;2&quot; name=&quot;2&quot; rel=&quot;2&quot;&gt;sadasd&lt;/a&gt;</p><p>&lt;a href=&quot;sadasd&quot; name=&quot;3&quot; rel=&quot;3&quot;&gt;sadasd&lt;/a&gt;</p><p>&lt;a href=&quot;sadasd&quot; name=&quot;2&quot; rel=&quot;2&quot; id=&quot;2&quot;&gt;sadasd&lt;/a&gt;<br
/> &lsquo;;<br
/> print anchors_demand_ids($big_str);</p><p>seems to be fine :)</p><p>PS: please delete my previous comment as it has no html chars.</p> ]]></content:encoded> </item> <item><title>By: (v)</title><link>http://davidwalsh.name/assign-anchor-ids-mootools#comment-873</link> <dc:creator>(v)</dc:creator> <pubDate>Sat, 26 Apr 2008 18:43:16 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=228#comment-873</guid> <description>http://regexlib.com/REDetails.aspx?regexp_id=1526 or:&lt;a\s+(?:(?:\w+\s*=\s*)(?:\w+&#124;&quot;[^&quot;]*&quot;&#124;&#039;[^&#039;]*&#039;))*?\s*href\s*=\s*(?\w+&#124;&quot;[^&quot;]*&quot;&#124;&#039;[^&#039;]*&#039;)(?:(?:\s+\w+\s*=\s*)(?:\w+&#124;&quot;[^&quot;]*&quot;&#124;&#039;[^&#039;]*&#039;))*?&gt;[^&lt;]+&lt;/a&gt;</description> <content:encoded><![CDATA[<p><a
href="http://regexlib.com/REDetails.aspx?regexp_id=1526" rel="nofollow">http://regexlib.com/REDetails.aspx?regexp_id=1526</a> or:</p><p>&lt;a\s+(?:(?:\w+\s*=\s*)(?:\w+|&#8221;[^"]*&#8221;|&#8217;[^']*&#8217;))*?\s*href\s*=\s*(?\w+|&#8221;[^"]*&#8221;|&#8217;[^']*&#8217;)(?:(?:\s+\w+\s*=\s*)(?:\w+|&#8221;[^"]*&#8221;|&#8217;[^']*&#8217;))*?&gt;[^&lt;]+</p> ]]></content:encoded> </item> <item><title>By: hcabbos</title><link>http://davidwalsh.name/assign-anchor-ids-mootools#comment-849</link> <dc:creator>hcabbos</dc:creator> <pubDate>Fri, 25 Apr 2008 01:06:34 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=228#comment-849</guid> <description>Your last sentence reads, &quot;Before enabling SmoothScroll, I look for all anchors and *an* ID attribute that mirrors the anchor’s name.&quot;Did you mean &quot;and add&quot; instead of &quot;and an&quot;?</description> <content:encoded><![CDATA[<p>Your last sentence reads, &#8220;Before enabling SmoothScroll, I look for all anchors and *an* ID attribute that mirrors the anchor’s name.&#8221;</p><p>Did you mean &#8220;and add&#8221; instead of &#8220;and an&#8221;?</p> ]]></content:encoded> </item> <item><title>By: Catar4x</title><link>http://davidwalsh.name/assign-anchor-ids-mootools#comment-845</link> <dc:creator>Catar4x</dc:creator> <pubDate>Thu, 24 Apr 2008 17:54:06 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=228#comment-845</guid> <description>Wow !!
It&#039;s very better than SmoothScroll.js normal !
Thanks a lot ;)</description> <content:encoded><![CDATA[<p>Wow !!<br
/> It&#8217;s very better than SmoothScroll.js normal !<br
/> Thanks a lot ;)</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 2/7 queries in 0.012 seconds using disk: basic
Object Caching 451/451 objects using disk: basic

Served from: davidwalsh.name @ 2012-05-21 03:57:52 -->
