<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: replaceAll with special caracter '$' error in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/replaceAll-with-special-caracter-error/m-p/2352731#M119072</link>
    <description>&lt;P&gt;Hello @Bruno Rocha​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;To fix the issue, you can encode/decode the special char $ in the replacement string before/after the method .replaceAll like the below:&lt;/P&gt;&lt;P&gt;String replacement= (context.eventosProcesso == null? "": context.eventosProcesso);&lt;/P&gt;&lt;P&gt;replacement=replacement.replaceAll("\\$", "US_DOLLAR");  //encode replacement&lt;/P&gt;&lt;P&gt;String resultString=text.replaceAll("eventosProcesso", replacement);&lt;/P&gt;&lt;P&gt;resultString=resultString.replaceAll("US_DOLLAR", "\\$");   //decode replacement&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Aiming&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jul 2023 01:05:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-07-12T01:05:48Z</dc:date>
    <item>
      <title>replaceAll with special caracter '$' error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/replaceAll-with-special-caracter-error/m-p/2352730#M119071</link>
      <description>&lt;P&gt;Hi There!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; I have an error related to 'replaceall' and the special character '$'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a conetxt variable that receives a text from the database. Part of&amp;nbsp;this text there is the character '$' which is part of the text. Ex: R$.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to use 'replaceall' and replace a information with the content of this variable it is returning the error 'java.lang.IllegalArgumentException: Illegal group reference'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I sow that the special caracter '$' with 'replaceall' cause this error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I correct this error without having to delete the special character from the text?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000kXbWZAA0.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149661i01CD8F42BB876D86/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000kXbWZAA0.png" alt="0695b00000kXbWZAA0.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;Exception in component tMap_2 (TESTE_EMAIL_FOLLOW_UP)&lt;/P&gt;&lt;P&gt;java.lang.IllegalArgumentException: Illegal group reference&lt;/P&gt;&lt;P&gt;	at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1068)&lt;/P&gt;&lt;P&gt;	at java.base/java.util.regex.Matcher.appendReplacement(Matcher.java:998)&lt;/P&gt;&lt;P&gt;	at java.base/java.util.regex.Matcher.replaceAll(Matcher.java:1182)&lt;/P&gt;&lt;P&gt;	at java.base/java.lang.String.replaceAll(String.java:2126)&lt;/P&gt;&lt;P&gt;	at savixx_bi.teste_email_follow_up_0_1.TESTE_EMAIL_FOLLOW_UP.tDBInput_3Process(TESTE_EMAIL_FOLLOW_UP.java:10343)&lt;/P&gt;&lt;P&gt;	at savixx_bi.teste_email_follow_up_0_1.TESTE_EMAIL_FOLLOW_UP.tDBInput_4Process(TESTE_EMAIL_FOLLOW_UP.java:9516)&lt;/P&gt;&lt;P&gt;	at savixx_bi.teste_email_follow_up_0_1.TESTE_EMAIL_FOLLOW_UP.tDBInput_1Process(TESTE_EMAIL_FOLLOW_UP.java:7688)&lt;/P&gt;&lt;P&gt;	at savixx_bi.teste_email_follow_up_0_1.TESTE_EMAIL_FOLLOW_UP.runJobInTOS(TESTE_EMAIL_FOLLOW_UP.java:15724)&lt;/P&gt;&lt;P&gt;	at savixx_bi.teste_email_follow_up_0_1.TESTE_EMAIL_FOLLOW_UP.main(TESTE_EMAIL_FOLLOW_UP.java:14761)&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:35:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/replaceAll-with-special-caracter-error/m-p/2352730#M119071</guid>
      <dc:creator>brpaula_</dc:creator>
      <dc:date>2024-11-15T21:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: replaceAll with special caracter '$' error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/replaceAll-with-special-caracter-error/m-p/2352731#M119072</link>
      <description>&lt;P&gt;Hello @Bruno Rocha​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;To fix the issue, you can encode/decode the special char $ in the replacement string before/after the method .replaceAll like the below:&lt;/P&gt;&lt;P&gt;String replacement= (context.eventosProcesso == null? "": context.eventosProcesso);&lt;/P&gt;&lt;P&gt;replacement=replacement.replaceAll("\\$", "US_DOLLAR");  //encode replacement&lt;/P&gt;&lt;P&gt;String resultString=text.replaceAll("eventosProcesso", replacement);&lt;/P&gt;&lt;P&gt;resultString=resultString.replaceAll("US_DOLLAR", "\\$");   //decode replacement&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Aiming&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 01:05:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/replaceAll-with-special-caracter-error/m-p/2352731#M119072</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-12T01:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: replaceAll with special caracter '$' error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/replaceAll-with-special-caracter-error/m-p/2352732#M119073</link>
      <description>&lt;P&gt;Try to use replace instead of replaceAll. ReplaceAll expects a regular expression where certain characters are part of the pattern.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So either you accept that your pattern has to be proper regex ( \\$ ) or you simply use replace.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 09:25:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/replaceAll-with-special-caracter-error/m-p/2352732#M119073</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-17T09:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: replaceAll with special caracter '$' error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/replaceAll-with-special-caracter-error/m-p/2352733#M119074</link>
      <description>&lt;P&gt;thanks @Balazs Gunics​&amp;nbsp;and @Aiming Chen​&amp;nbsp;...solved!!!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 17:35:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/replaceAll-with-special-caracter-error/m-p/2352733#M119074</guid>
      <dc:creator>brpaula_</dc:creator>
      <dc:date>2023-07-17T17:35:14Z</dc:date>
    </item>
  </channel>
</rss>

