<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Regex to replace any value having special character in string like 2121k$ ,  2121k€, 1000k CHF,  1000k EUR, 1000k USD</title><link>https://community.appian.com/discussions/f/general/35252/regex-to-replace-any-value-having-special-character-in-string-like-2121k-2121k-1000k-chf-1000k-eur-1000k-usd</link><description>Hi Team, 
 Can anyone please help me with regex to r eplace every number in string having following with space. 
 
 $ 
 € 
 CHF 
 EUR 
 USD 
 
 Example 
 1. Test 2121k$ test data :--&amp;gt; Test test data 
 2. Test 2121k € test data :--&amp;gt; T est test data 
 3</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Regex to replace any value having special character in string like 2121k$ ,  2121k€, 1000k CHF,  1000k EUR, 1000k USD</title><link>https://community.appian.com/thread/136969?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 16:30:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7d6380e9-a816-43c9-ad53-b3022060c1f0</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;a href="/members/yogip3177"&gt;Yogi Patel&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;(?:) is used for non-capturing groups.&lt;br /&gt;?: says &amp;quot;find any of these on the list,&amp;quot; but you don&amp;#39;t need to remember which one you actually found later.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regex to replace any value having special character in string like 2121k$ ,  2121k€, 1000k CHF,  1000k EUR, 1000k USD</title><link>https://community.appian.com/thread/136967?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 16:25:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a571ceb5-6114-46e5-87c7-f2d06d9ec7e5</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;&lt;a href="/members/bihitakd0001"&gt;bihitakdass&lt;/a&gt;&amp;nbsp; Let me know if that works for you&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;regexreplaceall(
  &amp;quot;\b\d+(\.\d+)?[kKmMbB]?\s*(?:[$€]|CHF|EUR|USD)\b&amp;quot;,
  PUT YOUR STRING HERE,
  &amp;quot; &amp;quot;
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regex to replace any value having special character in string like 2121k$ ,  2121k€, 1000k CHF,  1000k EUR, 1000k USD</title><link>https://community.appian.com/thread/136959?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 13:44:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e3b91d8e-2659-4231-8823-803ff22bfe0e</guid><dc:creator>Yogi Patel</dc:creator><description>&lt;p&gt;&amp;nbsp;&amp;quot;(&lt;strong&gt;?:&lt;/strong&gt;[$&amp;euro;]|CHF|EUR|USD)&amp;quot; can you please share the purpose of &lt;strong&gt;?:&lt;/strong&gt; in this regex?&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regex to replace any value having special character in string like 2121k$ ,  2121k€, 1000k CHF,  1000k EUR, 1000k USD</title><link>https://community.appian.com/thread/136951?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 12:43:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:84801244-a8b0-4231-85b4-7cff281637b2</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;The pipe character in RegEx acts as an &amp;quot;OR&amp;quot; operator - so you can extend the RegEx pattern accordingly:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;regexreplaceall(&amp;quot;\d+[k|K|m|M|b|B]\s*(?:[$€]|CHF|EUR|USD)&amp;quot;, ri!data ,&amp;quot; &amp;quot;)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regex to replace any value having special character in string like 2121k$ ,  2121k€, 1000k CHF,  1000k EUR, 1000k USD</title><link>https://community.appian.com/thread/136949?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 12:09:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:322aa3db-f1bb-406f-b3e6-8705ecc1f253</guid><dc:creator>bihitakdass</dc:creator><description>&lt;p&gt;Hi Shubham,&lt;br /&gt;Thanks this worked to certain extent but can you also suggest something for&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. Test 0.5M EUR Test :--&amp;gt;&amp;nbsp;&lt;span&gt;Test Test&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. Test 2121K&amp;euro; test data :--&amp;gt;&amp;nbsp;Test test data&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. Test&amp;nbsp;110EUR test data :--&amp;gt; Test test data&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4.&amp;nbsp;Test 7.95USD test data :--&amp;gt; Test test data&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This k can be in caps also like 211K and not just K, it can be Billion(&amp;quot;b&amp;quot; ,&amp;quot;B&amp;quot;) ,Million( &amp;quot;m&amp;quot; , &amp;quot;M&amp;quot;)&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So can you help in modifying the regex to accept&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regex to replace any value having special character in string like 2121k$ ,  2121k€, 1000k CHF,  1000k EUR, 1000k USD</title><link>https://community.appian.com/thread/136948?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 10:57:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c59ac755-6c3d-436e-ba4c-83de79231b35</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;There may be a more elegant way but it&amp;#39;s easiest to understand and implement as two expressions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;an expression that takes as its input the data you want processed and performs a fn!reduce() on it, using the list of currencies you want to find and replace with the space character&lt;/li&gt;
&lt;li&gt;a helper expression rule which is called by the above rule, which is called recursively by the fn!reduce() for each currency you want replaced. This uses the fn!regexreplaceall which uses a pattern to match on the string being and replaces all matches with, in this example, a space&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The first rule looks something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;fn!reduce(
  rule!SJB_ER_replaceCurrencyValue,
  ri!data,
  { &amp;quot;\$&amp;quot;, &amp;quot;€&amp;quot;, &amp;quot;CHF&amp;quot;, &amp;quot;EUR&amp;quot;, &amp;quot;USD&amp;quot; }
  /* note that the dollar symbol in the list above includes the backslash escape character as */
  /* the dollar symbol has a speical menaing in regex expressions */
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and the second rule looks like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;fn!regexreplaceall(
  concat(&amp;quot;[0-9]*k&amp;quot;, ri!currency),
  ri!data,
  &amp;quot; &amp;quot;
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you need any further explanation as to what&amp;#39;s happening here please ask.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regex to replace any value having special character in string like 2121k$ ,  2121k€, 1000k CHF,  1000k EUR, 1000k USD</title><link>https://community.appian.com/thread/136946?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 10:22:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:65dcb18d-232f-4693-9b81-ad463ef8a9f9</guid><dc:creator>Yogi Patel</dc:creator><description>&lt;p&gt;&lt;span&gt;Not sure about your exact requirements. You can try the following if the prefix and postfix string are fixed:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;left(&amp;quot;Test 1000k USD test data set&amp;quot;, 5) &amp;amp; right(&amp;quot;Test 1000k USD test data set&amp;quot;, 13)&lt;/pre&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regex to replace any value having special character in string like 2121k$ ,  2121k€, 1000k CHF,  1000k EUR, 1000k USD</title><link>https://community.appian.com/thread/136945?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 10:17:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c14af1c1-5d70-459a-8174-b18b47f4e009</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;&lt;a href="/members/bihitakd0001"&gt;bihitakdass&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Let me know if that works for you.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;regexreplaceall(&amp;quot;\d+k\s*(?:[$€]|CHF|EUR|USD)&amp;quot;, PUT YOUR STRING HERE ,&amp;quot; &amp;quot;)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>