<?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: Remove Non-numeric Characters in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/remove-non-numeric-characters/m-p/1419525#M82837</link>
    <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/608119"&gt;@FlightDeck&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you would like to use regular expression, you can use this:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import re
def remove_alpha(value):
    return re.sub('[^0-9\-]', '', str(value))&lt;/LI-CODE&gt;&lt;P&gt;While using it in this setup here:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CodyPatterson_0-1715015568124.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/103241iFCB47389720C7B6B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CodyPatterson_0-1715015568124.png" alt="CodyPatterson_0-1715015568124.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
    <pubDate>Mon, 06 May 2024 17:12:59 GMT</pubDate>
    <dc:creator>CodyPatterson</dc:creator>
    <dc:date>2024-05-06T17:12:59Z</dc:date>
    <item>
      <title>Remove Non-numeric Characters</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-non-numeric-characters/m-p/1419468#M82827</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;Looking for a simple way to remove any alphabetical characters from a field leaving only 1-9 and "-". Decimals shouldn't be an issue. Preferably python or arcade expression. Unfortunately Through searching I am unable to find a viable route to accomplish this task though the inverse is readily available. Any help is appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 16:12:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-non-numeric-characters/m-p/1419468#M82827</guid>
      <dc:creator>FlightDeck</dc:creator>
      <dc:date>2024-05-06T16:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Non-numeric Characters</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-non-numeric-characters/m-p/1419522#M82835</link>
      <description>&lt;P&gt;Depending on the data, one way without using regular expressions. would be to iterate over the string, and if the values match your 'keeplist', then join them to new string, then split that string into the list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;instring = 'your99number/textvaluses-4testing'
keeplist = '0123456789.-'
numList = [i for i in (''.join((num if num in keeplist else ' ') for num in instring)).split()]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 17:09:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-non-numeric-characters/m-p/1419522#M82835</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2024-05-06T17:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Non-numeric Characters</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-non-numeric-characters/m-p/1419525#M82837</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/608119"&gt;@FlightDeck&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you would like to use regular expression, you can use this:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import re
def remove_alpha(value):
    return re.sub('[^0-9\-]', '', str(value))&lt;/LI-CODE&gt;&lt;P&gt;While using it in this setup here:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CodyPatterson_0-1715015568124.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/103241iFCB47389720C7B6B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CodyPatterson_0-1715015568124.png" alt="CodyPatterson_0-1715015568124.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 17:12:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-non-numeric-characters/m-p/1419525#M82837</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2024-05-06T17:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Non-numeric Characters</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-non-numeric-characters/m-p/1419651#M82859</link>
      <description>&lt;P&gt;I am a big fan of regular expressions, which is why I am so disappointed the Python builtin re module has such weak support for Unicode categories.&amp;nbsp; Fortunately, it is quite common that people will bundle &lt;A href="https://pypi.org/project/regex/#description" target="_blank"&gt;regex · PyPI&lt;/A&gt; with their Python deployments, including Esri.&lt;/P&gt;&lt;P&gt;Using regex instead of re allows for people to use Unicode categories to write regular expressions that are much more portable in this global world we live in:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import regex
def remove_alpha(value):
    return regex.sub("[^\p{NUMBER}\p{DASH}]", "", str(value))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 06 May 2024 20:33:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-non-numeric-characters/m-p/1419651#M82859</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-05-06T20:33:26Z</dc:date>
    </item>
  </channel>
</rss>

