<?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: Regex assist needed in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31816#M2504</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Justin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you are looping through the rows but you are not looping through your fields and assigning any data to a particular field. Have a look at some of these examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001q000000" title="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001q000000"&gt;ArcGIS Desktop&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018v00000064000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//018v00000064000000"&gt;ArcGIS Help 10.1&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Jul 2014 20:35:00 GMT</pubDate>
    <dc:creator>AnthonyGiles</dc:creator>
    <dc:date>2014-07-28T20:35:00Z</dc:date>
    <item>
      <title>Regex assist needed</title>
      <link>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31814#M2502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to remove "/1" from the end of every entry in a certain field.&amp;nbsp; I know I can just strip it off, but I would like to solve it with regex for my own edification.&amp;nbsp; Here is my code so far.&amp;nbsp; It runs without error but has no effect on the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with arcpy.da.UpdateCursor("Table", "parcel_ID") as rows:&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; badtext=row[0]&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; goodtext=re.sub(r'/1', '', badtext)&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0]=goodtext&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone know what I am doing wrong? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 20:16:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31814#M2502</guid>
      <dc:creator>JustinWhisenant</dc:creator>
      <dc:date>2014-07-28T20:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assist needed</title>
      <link>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31815#M2503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you probably need this after row[0] = goodtext&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rows.&lt;SPAN class="n"&gt;updateRow&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;row&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="p"&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//018w00000014000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//018w00000014000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt;‌&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 20:32:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31815#M2503</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-07-28T20:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assist needed</title>
      <link>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31816#M2504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Justin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you are looping through the rows but you are not looping through your fields and assigning any data to a particular field. Have a look at some of these examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001q000000" title="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001q000000"&gt;ArcGIS Desktop&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018v00000064000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//018v00000064000000"&gt;ArcGIS Help 10.1&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 20:35:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31816#M2504</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2014-07-28T20:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assist needed</title>
      <link>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31817#M2505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anthony, he is calling the value of one field he is accessing with cursor with his index.&amp;nbsp; You posted help for the old cursor, not the data access cursor, for which his syntax should be fine, since it takes a feature class name, and field(s) which he has(assuming his feature is called "Table")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;He isn't looping through multiple fields, just the one field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 20:40:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31817#M2505</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-07-28T20:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assist needed</title>
      <link>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31818#M2506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cheers Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have just read this help and what you are saying makes sense:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000014000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000014000000"&gt;ArcGIS Help 10.1&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 20:45:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31818#M2506</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2014-07-28T20:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assist needed</title>
      <link>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31819#M2507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;tbh, I posted the wrong help the first time too and had to go correct myself, its easy to get the regular and data access cursors mixed up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 20:49:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31819#M2507</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-07-28T20:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assist needed</title>
      <link>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31820#M2508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will python in arcmap recognise the \Z metacharacter to ensure only the end of the string is changed and not any occurrences in the rest of the text&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 20:56:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31820#M2508</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2014-07-28T20:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assist needed</title>
      <link>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31821#M2509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't see why it wouldn't, I've never tested it but I would assume it would work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 21:03:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31821#M2509</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-07-28T21:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Regex assist needed</title>
      <link>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31822#M2510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you that was the problem.&amp;nbsp; I forgot to apply the update.&amp;nbsp; It seems obvious now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 21:10:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/regex-assist-needed/m-p/31822#M2510</guid>
      <dc:creator>JustinWhisenant</dc:creator>
      <dc:date>2014-07-28T21:10:11Z</dc:date>
    </item>
  </channel>
</rss>

