<?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>How should I design this Regulat expression to get rid of leading 0 from String?</title><link>https://community.appian.com/discussions/f/general/18895/how-should-i-design-this-regulat-expression-to-get-rid-of-leading-0-from-string</link><description>I have a Text string &amp;quot;00000012345608912&amp;quot; 
 
 regexreplaceall(&amp;quot;0*$&amp;quot;,&amp;quot;00000012345608912&amp;quot;,&amp;quot;&amp;quot;), This will remove the 0 in tail. 
 
 
 I want result to be 12345608912, remove the first leading 0 numbers. 
 
 Thanks</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How should I design this Regulat expression to get rid of leading 0 from String?</title><link>https://community.appian.com/thread/74275?ContentTypeID=1</link><pubDate>Thu, 21 May 2020 20:25:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:38a5f7ab-a67c-4d26-ae30-7c4d0b821dbf</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;ooh, that&amp;#39;s handy, that way didn&amp;#39;t occur to me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How should I design this Regulat expression to get rid of leading 0 from String?</title><link>https://community.appian.com/thread/74274?ContentTypeID=1</link><pubDate>Thu, 21 May 2020 20:25:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f4b16a8f-bb59-4a62-ab03-b743d845c410</guid><dc:creator>peiranl0001</dc:creator><description>&lt;p&gt;Thanks, I figure this out.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I can use&amp;nbsp;text(7324314,&amp;quot;0000000000&amp;quot;) to make this happened.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How should I design this Regulat expression to get rid of leading 0 from String?</title><link>https://community.appian.com/thread/74273?ContentTypeID=1</link><pubDate>Thu, 21 May 2020 20:24:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:51de5381-ffd6-43da-8cdf-6105a551d0d0</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure you can do that with the regex function, but i&amp;#39;m guessing you could make use of something like the Appian function padLeft().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How should I design this Regulat expression to get rid of leading 0 from String?</title><link>https://community.appian.com/thread/74272?ContentTypeID=1</link><pubDate>Thu, 21 May 2020 20:10:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5ff76f2e-b6ad-4145-ab22-c56158174cc1</guid><dc:creator>peiranl0001</dc:creator><description>&lt;p&gt;Thanks Mike!&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This working perfetly!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Another question is how to add leading zero to make string 10 digital?&lt;/p&gt;
&lt;p&gt;For example&amp;nbsp; I have number 15423, my result should be 0000015423,&lt;/p&gt;
&lt;p&gt;number 234, then the result should be 0000000234&lt;/p&gt;
&lt;p&gt;How should I do that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How should I design this Regulat expression to get rid of leading 0 from String?</title><link>https://community.appian.com/thread/74271?ContentTypeID=1</link><pubDate>Thu, 21 May 2020 19:35:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d1b52443-2532-41c1-98cb-c5489b071b68</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;As far as I know you need to use the &amp;quot;^&amp;quot; operator to indicate that you want the match to be from the beginning of the string (you currently have it set to match to the end of the string).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;regexreplaceall(&amp;quot;^0*&amp;quot;,&amp;quot;00000012345608912&amp;quot;,&amp;quot;&amp;quot;)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>