<?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: JavaScript RegExp based highlighting for MooTools and jQuery</title>
	<atom:link href="http://devthought.com/blog/client-side/2009/04/javascript-regexp-based-highlighting-function-for-mootools-and-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://devthought.com/blog/client-side/2009/04/javascript-regexp-based-highlighting-function-for-mootools-and-jquery/</link>
	<description>PHP, Symfony, JavaScript, jQuery, MooTools consultant.</description>
	<pubDate>Mon, 15 Mar 2010 14:02:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: 4vconnect (willians pereira)</title>
		<link>http://devthought.com/blog/client-side/2009/04/javascript-regexp-based-highlighting-function-for-mootools-and-jquery/comment-page-1/#comment-4837</link>
		<dc:creator>4vconnect (willians pereira)</dc:creator>
		<pubDate>Thu, 24 Sep 2009 16:26:51 +0000</pubDate>
		<guid isPermaLink="false">http://devthought.com/?p=725#comment-4837</guid>
		<description>o poder do js efeito simples mas bem elaborado. http://tinyurl.com/c4npup</description>
		<content:encoded><![CDATA[<p>o poder do js efeito simples mas bem elaborado. <a href="http://tinyurl.com/c4npup" rel="nofollow">http://tinyurl.com/c4npup</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kune.fr &#187; Blog Archive &#187; WP Serie: Les meilleurs hacks wordpress #1</title>
		<link>http://devthought.com/blog/client-side/2009/04/javascript-regexp-based-highlighting-function-for-mootools-and-jquery/comment-page-1/#comment-4706</link>
		<dc:creator>Kune.fr &#187; Blog Archive &#187; WP Serie: Les meilleurs hacks wordpress #1</dc:creator>
		<pubDate>Tue, 11 Aug 2009 16:02:24 +0000</pubDate>
		<guid isPermaLink="false">http://devthought.com/?p=725#comment-4706</guid>
		<description>[...] (le code jQuery a été adapté de devthought’s JavaScript RegExp based highlighting.) [...]</description>
		<content:encoded><![CDATA[<p>[...] (le code jQuery a été adapté de devthought’s JavaScript RegExp based highlighting.) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Highlight Your Searches &#171; Rohit Singh Sengar</title>
		<link>http://devthought.com/blog/client-side/2009/04/javascript-regexp-based-highlighting-function-for-mootools-and-jquery/comment-page-1/#comment-4697</link>
		<dc:creator>Highlight Your Searches &#171; Rohit Singh Sengar</dc:creator>
		<pubDate>Fri, 07 Aug 2009 09:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://devthought.com/?p=725#comment-4697</guid>
		<description>[...] article can be reached here. It helped me a lot in highlighting the searches in result. It can be used anywhere with any script [...]</description>
		<content:encoded><![CDATA[<p>[...] article can be reached here. It helped me a lot in highlighting the searches in result. It can be used anywhere with any script [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to Highlight Search Terms with jQuery &#124; Weblog Tools Collection</title>
		<link>http://devthought.com/blog/client-side/2009/04/javascript-regexp-based-highlighting-function-for-mootools-and-jquery/comment-page-1/#comment-3890</link>
		<dc:creator>How to Highlight Search Terms with jQuery &#124; Weblog Tools Collection</dc:creator>
		<pubDate>Fri, 10 Apr 2009 11:00:58 +0000</pubDate>
		<guid isPermaLink="false">http://devthought.com/?p=725#comment-3890</guid>
		<description>[...] (jQuery code slightly adapted from devthought&#8217;s JavaScript RegExp based highlighting.) [...]</description>
		<content:encoded><![CDATA[<p>[...] (jQuery code slightly adapted from devthought&#8217;s JavaScript RegExp based highlighting.) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guillermo Rauch</title>
		<link>http://devthought.com/blog/client-side/2009/04/javascript-regexp-based-highlighting-function-for-mootools-and-jquery/comment-page-1/#comment-3847</link>
		<dc:creator>Guillermo Rauch</dc:creator>
		<pubDate>Sun, 05 Apr 2009 18:46:26 +0000</pubDate>
		<guid isPermaLink="false">http://devthought.com/?p=725#comment-3847</guid>
		<description>Malformed HTML is not an issue.  Plus, the only way to reliably walk the DOM is with well formed XML is in the first place :)

This is not the definite highlighting solution, but it's good for many purposes.</description>
		<content:encoded><![CDATA[<p>Malformed HTML is not an issue.  Plus, the only way to reliably walk the DOM is with well formed XML is in the first place <img src='http://devthought.com/wp-content/plugins/smilies-themer/devthought/smile.png' alt=':)' class='wp-smiley' /><br />
This is not the definite highlighting solution, but it&#8217;s good for many purposes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://devthought.com/blog/client-side/2009/04/javascript-regexp-based-highlighting-function-for-mootools-and-jquery/comment-page-1/#comment-3846</link>
		<dc:creator>James</dc:creator>
		<pubDate>Sun, 05 Apr 2009 16:28:24 +0000</pubDate>
		<guid isPermaLink="false">http://devthought.com/?p=725#comment-3846</guid>
		<description>I tried something like this a while ago (http://james.padolsey.com/javascript/highlighting-text-with-javascript/), but, as evident from one of the comments, using regular expressions + innerHTML is not a good idea. Not only is malformed HTML an issue, but, as you've said, it can mess up events and properties of elements within. The only solid way to achieve this it to walk the DOM and look for text nodes. (node.nodeType === 3)</description>
		<content:encoded><![CDATA[<p>I tried something like this a while ago (http://james.padolsey.com/javascript/highlighting-text-with-javascript/), but, as evident from one of the comments, using regular expressions + innerHTML is not a good idea. Not only is malformed HTML an issue, but, as you&#8217;ve said, it can mess up events and properties of elements within. The only solid way to achieve this it to walk the DOM and look for text nodes. (node.nodeType === 3)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jörn Zaefferer</title>
		<link>http://devthought.com/blog/client-side/2009/04/javascript-regexp-based-highlighting-function-for-mootools-and-jquery/comment-page-1/#comment-3844</link>
		<dc:creator>Jörn Zaefferer</dc:creator>
		<pubDate>Sun, 05 Apr 2009 09:30:08 +0000</pubDate>
		<guid isPermaLink="false">http://devthought.com/?p=725#comment-3844</guid>
		<description>Thanks for sharing!

I was using this regex so far in my autocomplete plugin, I'm now trying to figure out the differences and which version is more effective:

return value.replace(new RegExp("(?![^&#38;;]+;)(?!&#60;[^]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\&#124;\\])/gi, "\\$1") + ")(?![^]*&#62;)(?![^&#38;;]+;)", "gi"), "&lt;strong&gt;$1&lt;/strong&gt;");

The term-replace seems to be very similar, still not the same. The value-replace is quite different. Your version is certainly easier to understand...</description>
		<content:encoded><![CDATA[<p>Thanks for sharing!</p>
<p>I was using this regex so far in my autocomplete plugin, I&#8217;m now trying to figure out the differences and which version is more effective:</p>
<p>return value.replace(new RegExp(&#8221;(?![^&amp;;]+;)(?!&lt;[^]*)(&#8221; + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, &#8220;\\$1&#8243;) + &#8220;)(?![^]*&gt;)(?![^&amp;;]+;)&#8221;, &#8220;gi&#8221;), &#8220;<strong>$1</strong>&#8220;);</p>
<p>The term-replace seems to be very similar, still not the same. The value-replace is quite different. Your version is certainly easier to understand&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rendez</title>
		<link>http://devthought.com/blog/client-side/2009/04/javascript-regexp-based-highlighting-function-for-mootools-and-jquery/comment-page-1/#comment-3841</link>
		<dc:creator>Rendez</dc:creator>
		<pubDate>Sun, 05 Apr 2009 00:18:53 +0000</pubDate>
		<guid isPermaLink="false">http://devthought.com/?p=725#comment-3841</guid>
		<description>Cool Guillermo!

I had the need to develop this one before, never released though, ouch!

Very clean code ;)</description>
		<content:encoded><![CDATA[<p>Cool Guillermo!</p>
<p>I had the need to develop this one before, never released though, ouch!</p>
<p>Very clean code <img src='http://devthought.com/wp-content/plugins/smilies-themer/devthought/wink.png' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
