<?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: Case-insensitive replaceAll in Java</title>
	<atom:link href="http://jelaniharris.com/2009/case-insensitive-replaceall-in-java/feed/" rel="self" type="application/rss+xml" />
	<link>http://jelaniharris.com/2009/case-insensitive-replaceall-in-java/</link>
	<description>The original website of Jelani Harris the original of course</description>
	<lastBuildDate>Mon, 19 Jul 2010 16:57:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Jelani Harris</title>
		<link>http://jelaniharris.com/2009/case-insensitive-replaceall-in-java/comment-page-1/#comment-90</link>
		<dc:creator>Jelani Harris</dc:creator>
		<pubDate>Mon, 19 Jul 2010 16:57:56 +0000</pubDate>
		<guid isPermaLink="false">http://jelaniharris.com/?p=67#comment-90</guid>
		<description>Hello Celso,

I had a hard time trying to follow what exactly you&#039;re trying to do here so I&#039;ll make a few quick assumptions. I&#039;m assuming that you don&#039;t want to eat the whitespace after the search term.

The regex you have set up now is looking for the term &quot;celso&quot; and one other character that is not a single quote (&#039;). Because the space character is not a quote the regex matches the term and a single space - then does the replacement. If you were to set the regex to:
&lt;code&gt;String regex = &quot;&quot;; &lt;/code&gt;
Then you&#039;d be matching all variations of celso without the spaces. 

However if you &lt;strong&gt;just &lt;/strong&gt;wanted to match the WORD &quot;celso&quot;, and not part of another word of a mistype (such as &quot;celsOOOOO&quot; which would turn into &quot;OOOO&quot;) you can use the word boundary regex:
&lt;code&gt;String regex = &quot;\\b&quot;; &lt;/code&gt;

I hope I helped.</description>
		<content:encoded><![CDATA[<p>Hello Celso,</p>
<p>I had a hard time trying to follow what exactly you&#8217;re trying to do here so I&#8217;ll make a few quick assumptions. I&#8217;m assuming that you don&#8217;t want to eat the whitespace after the search term.</p>
<p>The regex you have set up now is looking for the term &#8220;celso&#8221; and one other character that is not a single quote (&#8216;). Because the space character is not a quote the regex matches the term and a single space &#8211; then does the replacement. If you were to set the regex to:<br />
<code>String regex = ""; </code><br />
Then you&#8217;d be matching all variations of celso without the spaces. </p>
<p>However if you <strong>just </strong>wanted to match the WORD &#8220;celso&#8221;, and not part of another word of a mistype (such as &#8220;celsOOOOO&#8221; which would turn into &#8220;OOOO&#8221;) you can use the word boundary regex:<br />
<code>String regex = "\\b"; </code></p>
<p>I hope I helped.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: celso</title>
		<link>http://jelaniharris.com/2009/case-insensitive-replaceall-in-java/comment-page-1/#comment-89</link>
		<dc:creator>celso</dc:creator>
		<pubDate>Sun, 18 Jul 2010 20:05:50 +0000</pubDate>
		<guid isPermaLink="false">http://jelaniharris.com/?p=67#comment-89</guid>
		<description>&lt;pre lang=&quot;Javascript&quot;&gt;String regex = &quot;[^&#039;]&quot;;
String insentiveCase = &quot;(?i)&quot;;

String DOCUMENTO_SAIDA = &quot;celso foi  celso Celso CELSO&quot;;
String anotacao = &quot;&quot;;
 String termo = &quot;celso&quot;;

DOCUMENTO_SAIDA = DOCUMENTO_SAIDA.replaceAll(insentiveCase + termo + regex, anotacao);

System.out.println(DOCUMENTO_SAIDA);
&lt;/pre&gt;
foi  CELSO

But... he eats space char after the replaced &quot;termo&quot;</description>
		<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">String regex <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;[^']&quot;</span><span style="color: #339933;">;</span>
String insentiveCase <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;(?i)&quot;</span><span style="color: #339933;">;</span>
&nbsp;
String DOCUMENTO_SAIDA <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;celso foi  celso Celso CELSO&quot;</span><span style="color: #339933;">;</span>
String anotacao <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
 String termo <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;celso&quot;</span><span style="color: #339933;">;</span>
&nbsp;
DOCUMENTO_SAIDA <span style="color: #339933;">=</span> DOCUMENTO_SAIDA.<span style="color: #660066;">replaceAll</span><span style="color: #009900;">&#40;</span>insentiveCase <span style="color: #339933;">+</span> termo <span style="color: #339933;">+</span> regex<span style="color: #339933;">,</span> anotacao<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
System.<span style="color: #660066;">out</span>.<span style="color: #660066;">println</span><span style="color: #009900;">&#40;</span>DOCUMENTO_SAIDA<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>foi  CELSO</p>
<p>But&#8230; he eats space char after the replaced &#8220;termo&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jelani Harris</title>
		<link>http://jelaniharris.com/2009/case-insensitive-replaceall-in-java/comment-page-1/#comment-88</link>
		<dc:creator>Jelani Harris</dc:creator>
		<pubDate>Thu, 17 Jun 2010 14:26:43 +0000</pubDate>
		<guid isPermaLink="false">http://jelaniharris.com/?p=67#comment-88</guid>
		<description>Hello Shahin,
I added a $ to my example string and the replaceAll still worked.</description>
		<content:encoded><![CDATA[<p>Hello Shahin,<br />
I added a $ to my example string and the replaceAll still worked.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shahin</title>
		<link>http://jelaniharris.com/2009/case-insensitive-replaceall-in-java/comment-page-1/#comment-86</link>
		<dc:creator>Shahin</dc:creator>
		<pubDate>Wed, 02 Jun 2010 16:30:08 +0000</pubDate>
		<guid isPermaLink="false">http://jelaniharris.com/?p=67#comment-86</guid>
		<description>If you have $ sign in your sentence it wouldn&#039;t work.
like 
String sentence = &quot;The sly brown Fox jumped$ over the lazy foX.&quot;;</description>
		<content:encoded><![CDATA[<p>If you have $ sign in your sentence it wouldn&#8217;t work.<br />
like<br />
String sentence = &#8220;The sly brown Fox jumped$ over the lazy foX.&#8221;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leandro</title>
		<link>http://jelaniharris.com/2009/case-insensitive-replaceall-in-java/comment-page-1/#comment-77</link>
		<dc:creator>Leandro</dc:creator>
		<pubDate>Thu, 18 Feb 2010 19:43:40 +0000</pubDate>
		<guid isPermaLink="false">http://jelaniharris.com/?p=67#comment-77</guid>
		<description>Hi! It doesn&#039;t work with accents ... :/
Try: Águia
I consider this a bug.

Do you know some workaround?</description>
		<content:encoded><![CDATA[<p>Hi! It doesn&#8217;t work with accents &#8230; :/<br />
Try: Águia<br />
I consider this a bug.</p>
<p>Do you know some workaround?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
