<?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 ordinals in an address in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/remove-ordinals-in-an-address/m-p/1313348#M68288</link>
    <description>&lt;P&gt;Here it is in action-&lt;/P&gt;&lt;LI-CODE lang="python"&gt;addrs = ['SE 1ST ST', 'SE 2ND ST', 'SE 03RD ST', 'SE 15TH ST']

comp = re.compile(r"(?&amp;lt;=\d)ST|TH|ND|RD")

for a in addrs:
    match = comp.search(a)
    f = comp.sub("", a)
    print(f'Changed {match.group(0)} : {a} : {f}')&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 29 Jul 2023 11:59:19 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2023-07-29T11:59:19Z</dc:date>
    <item>
      <title>Remove ordinals in an address</title>
      <link>https://community.esri.com/t5/python-questions/remove-ordinals-in-an-address/m-p/1313142#M68280</link>
      <description>&lt;P&gt;Hi, I'm using Pro 3.1.2. I have a database with street names that I need to remove all the ordinals from. So "SE 1ST ST" would just be "SE 1 ST"; "SE 44TH ST" would become SE 44 ST" etc. I need to remove the "ST" when it signifies first (1ST) but not when it signifies Street (also ST). So only after a number. The same with "TH" in "44TH", but not in "NORTH." I'm having trouble writing something that will catch and remove the ordinals only after a number 0-9.&lt;/P&gt;&lt;P&gt;I've tried to use this without any luck&lt;/P&gt;&lt;PRE&gt;(?&amp;lt;=[0-9])(?:st|nd|rd|th)&lt;/PRE&gt;&lt;P&gt;Does anyone have any suggestions? Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 16:13:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/remove-ordinals-in-an-address/m-p/1313142#M68280</guid>
      <dc:creator>Michael_Kleinman</dc:creator>
      <dc:date>2023-07-28T16:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ordinals in an address</title>
      <link>https://community.esri.com/t5/python-questions/remove-ordinals-in-an-address/m-p/1313220#M68281</link>
      <description>&lt;P&gt;&lt;A href="https://regex101.com/" target="_blank" rel="noopener"&gt;https://regex101.com/&lt;/A&gt;&amp;nbsp; make sure you select python on the left, copy some strings into the test string and build away at the top.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;(\d+ST)|(\d+ND)|(\d+RD)|(\d+TH)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;captures the ##ST ##ND ##RD ##TH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;(?&amp;lt;=\d)ST|TH|ND|RD&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;captures just the ST, ND, TH, RD&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;1st Alternative&lt;/SPAN&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;(?&amp;lt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;\d&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;ST&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Positive Lookbehind &lt;/SPAN&gt;&lt;SPAN class=""&gt;(?&amp;lt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;\d&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;DIV class=""&gt;Assert that the Regex below matches &lt;SPAN class=""&gt;\d&lt;/SPAN&gt; &lt;SPAN&gt;matches a digit (equivalent to &lt;SPAN class=""&gt;[0-9]&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;ST &lt;SPAN class=""&gt;&lt;SPAN&gt;matches the characters &lt;SPAN class=""&gt;ST&lt;/SPAN&gt; literally (case sensitive)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;2nd Alternative&lt;/SPAN&gt;&lt;DIV class=""&gt;TH &lt;SPAN class=""&gt;&lt;SPAN&gt;matches the characters &lt;SPAN class=""&gt;TH&lt;/SPAN&gt; literally (case sensitive)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;3rd Alternative&lt;/SPAN&gt;&lt;DIV class=""&gt;ND &lt;SPAN class=""&gt;&lt;SPAN&gt;matches the characters &lt;SPAN class=""&gt;ND&lt;/SPAN&gt; literally (case sensitive)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;4th Alternative&lt;/SPAN&gt;&lt;DIV class=""&gt;RD &lt;SPAN class=""&gt;&lt;SPAN&gt;matches the characters &lt;SPAN class=""&gt;RD&lt;/SPAN&gt; literally (case sensitive)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 31 Jul 2023 12:53:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/remove-ordinals-in-an-address/m-p/1313220#M68281</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-07-31T12:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ordinals in an address</title>
      <link>https://community.esri.com/t5/python-questions/remove-ordinals-in-an-address/m-p/1313348#M68288</link>
      <description>&lt;P&gt;Here it is in action-&lt;/P&gt;&lt;LI-CODE lang="python"&gt;addrs = ['SE 1ST ST', 'SE 2ND ST', 'SE 03RD ST', 'SE 15TH ST']

comp = re.compile(r"(?&amp;lt;=\d)ST|TH|ND|RD")

for a in addrs:
    match = comp.search(a)
    f = comp.sub("", a)
    print(f'Changed {match.group(0)} : {a} : {f}')&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 29 Jul 2023 11:59:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/remove-ordinals-in-an-address/m-p/1313348#M68288</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-07-29T11:59:19Z</dc:date>
    </item>
  </channel>
</rss>

