<?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: Extract particular values from field in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67452#M5507</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to be sure, these are open text fields, that do not follow any particular format, correct?&amp;nbsp; Looks like your'e dealing with building permits which is what I'm currently working with; just say know to free form text fields!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At any rate I just created a test table with two fields: freeText and bpField.&amp;nbsp; Here is the code for a search cursor that returns the values you provide above: turn it into an update cursor to update the 'other field' to newValue....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'J:\ProProjects\weedcontrol\Default.gdb'&lt;/SPAN&gt;

table &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'testTable'&lt;/SPAN&gt;

field &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'freeText'&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;table&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;field&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        rowList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;' '&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rowList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; i&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startswith&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'B'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt;  i&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isdigit&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                newValue &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; f&lt;SPAN class="string token"&gt;'{i} 0'&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;newValue&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#returns:&lt;/SPAN&gt;

B24501000 &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
B34567000 &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
B33561000 &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
B14356000 &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 22:35:40 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2021-12-10T22:35:40Z</dc:date>
    <item>
      <title>Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67450#M5505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need help with extract a particulate value from the field "PojectIinfo" field.&amp;nbsp; I need to only extract the value/characters of the letter B and the 10 digits after the B an place it in the field "BP".&lt;/P&gt;&lt;P&gt;There might be a space in that value as well, for example B24501000 space 0. The total characters would be 11; B plus 10 digits. I am thinking i need to use re.compile but i am uncertain on the code.&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current field looks like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New SFR w/Attached Garage, covered parch and patio B24501000 0&amp;nbsp; &amp;gt;&amp;gt;&amp;gt;&lt;STRONG&gt;&lt;SPAN style="text-decoration: underline;"&gt;Extract B24501000 0&lt;/SPAN&gt; to BP field&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;B34567000 0 30 X 48 Pole Barn &amp;gt;&amp;gt;&amp;gt;&lt;STRONG&gt;Extract &lt;SPAN style="text-decoration: underline;"&gt;B34567000 0&lt;/SPAN&gt; to BP field&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;NEW 22,778 SQ FT B33561000 0 Addition to existing hop building &amp;gt;&amp;gt;&amp;gt;&lt;STRONG&gt;Extract &lt;SPAN style="text-decoration: underline;"&gt;B33561000 0&lt;/SPAN&gt; to BP field&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Residential B14356000 0 Storage&amp;gt;&amp;gt;&amp;gt;&lt;STRONG&gt;Extract &lt;SPAN style="text-decoration: underline;"&gt;B14356000 0&lt;/SPAN&gt; to BP field&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2020 21:13:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67450#M5505</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2020-03-06T21:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67451#M5506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;s = !YourFieldName!&lt;/P&gt;&lt;P&gt;Field calculator expression for your field BP&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;s&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;s&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;index&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"B"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;s&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;index&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"B"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;11&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;# ---- using slicing‍&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2020 21:54:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67451#M5506</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-06T21:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67452#M5507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to be sure, these are open text fields, that do not follow any particular format, correct?&amp;nbsp; Looks like your'e dealing with building permits which is what I'm currently working with; just say know to free form text fields!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At any rate I just created a test table with two fields: freeText and bpField.&amp;nbsp; Here is the code for a search cursor that returns the values you provide above: turn it into an update cursor to update the 'other field' to newValue....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'J:\ProProjects\weedcontrol\Default.gdb'&lt;/SPAN&gt;

table &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'testTable'&lt;/SPAN&gt;

field &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'freeText'&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;table&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;field&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        rowList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;' '&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rowList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; i&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startswith&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'B'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt;  i&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isdigit&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                newValue &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; f&lt;SPAN class="string token"&gt;'{i} 0'&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;newValue&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#returns:&lt;/SPAN&gt;

B24501000 &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
B34567000 &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
B33561000 &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
B14356000 &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:35:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67452#M5507</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-10T22:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67453#M5508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps the following.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import re

recs = [
    "New SFR w/Attached Garage, covered parch and patio B24501000 0", # B24501000 0
    "B34567000 0 30 X 48 Pole Barn", # B34567000 0
    "NEW 22,778 SQ FT B33561000 0 Addition to existing hop building", # B33561000 0
    "Residential B143560000 Storage" # B14356000 
    ]

pattern = re.compile(r"(&lt;B&gt;[\d ?]{8,10})") # B followed by 8-10 digits, may include space

for rec in recs:
    print(pattern.findall(rec)[0].strip()) # strip trims a trailing space

''' Results:   
B24501000 0
B34567000 0
B33561000 0
B143560000
'''‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/CODE&gt;&lt;B&gt;&lt;/B&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:35:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67453#M5508</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-10T22:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67454#M5509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get Failure During processing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2020 23:05:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67454#M5509</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2020-03-06T23:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67455#M5510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes a text field and no particular format.&lt;/P&gt;&lt;P&gt;I get the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i.startswith('B') and&amp;nbsp; i[1].isdigit():&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2020 23:07:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67455#M5510</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2020-03-06T23:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67456#M5511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have &amp;lt;null&amp;gt; in the data field, you have to query first for "not null"&lt;/P&gt;&lt;P&gt;What expression did you put in exactly?&amp;nbsp;&lt;/P&gt;&lt;P&gt;You were using the field calculator with a python parser?&lt;/P&gt;&lt;P&gt;You replace what I had between the !...! marks with your source field name?&lt;/P&gt;&lt;P&gt;And your destination field is a text field, right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2020 23:23:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67456#M5511</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-06T23:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67457#M5512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You do get it or don't get it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2020 23:31:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67457#M5512</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-03-06T23:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67458#M5513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After looking at the field a little closer there are Alphas characters in some records instead of a space. I need to get those as well. I would also like to add a 0 (zero) to the spaces &lt;SPAN style="text-decoration: underline;"&gt;if there is no&lt;/SPAN&gt; Alph character if possible.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;Single Family Res B34561000A0 &amp;gt;&amp;gt;&amp;gt;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN style="text-decoration: underline;"&gt;Extract B34561000A0&lt;/SPAN&gt; to BP field&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;New SFR w/Attached Garage, covered parch and patio B24501000 0&lt;STRONG&gt;&amp;nbsp; &amp;gt;&amp;gt;&amp;gt;&lt;STRONG&gt;&lt;SPAN style="text-decoration: underline;"&gt;Extract B2450100000&lt;/SPAN&gt; to BP field&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2020 23:35:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67458#M5513</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2020-03-06T23:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67459#M5514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry about that. I get the following error.&lt;/P&gt;&lt;P&gt;IndexError: string index out of range&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On line&lt;/P&gt;&lt;P&gt;if i.startswith('B') and&amp;nbsp; i[1].isdigit():&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2020 23:36:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67459#M5514</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2020-03-06T23:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67460#M5515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any other corner cases?&amp;nbsp; Nulls?&amp;nbsp; Permits that will kill a simple case(&amp;nbsp;&lt;STRONG&gt;B1 BBQ and Bar&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold; font-size: 14px;"&gt;&lt;SPAN&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold;"&gt;&lt;STRONG style="border: 0px; font-weight: inherit; text-decoration: underline; "&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;B245010000&amp;nbsp; &amp;nbsp;0&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2020 23:40:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67460#M5515</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-06T23:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67461#M5516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are getting an out of range error, that tells me that the list we make out of the field value has only 1 or 0 elements.&amp;nbsp; You can trap for that something like:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;table&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;field&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        rowList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;' '&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rowList&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
           &lt;SPAN class="keyword token"&gt;pass&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
           &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rowList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But from the sounds of it, you've got some funky funky stuff in there.&amp;nbsp; Hence my feelings on free text fields.&amp;nbsp; I hate 'em....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:35:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67461#M5516</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-10T22:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67462#M5517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Updated expression used in my previous code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import re

recs = [
    "New SFR w/Attached Garage, covered parch and patio B24501000 0", # B24501000 0
    "B34567000 0 30 X 48 Pole Barn", # B34567000 0
    "NEW 22,778 SQ FT B33561000 0 Addition to existing hop building", # B33561000 0
    "Residential B143560000 Storage", # B14356000
    "Single Family Res B34561000A0", # B34561000A0
    "New SFR w/Attached Garage, covered parch and patio B24501000 0" # B2450100000 
    ]

pattern = re.compile(r"(&lt;B&gt;[\d]+[A-Z][\d]*|&lt;B&gt;[\d]+[\s][\d]*)"

for rec in recs:
    print(pattern.findall(rec)[0].strip())

'''
Results:
B24501000 0
B34567000 0
B33561000 0
B143560000
B34561000A0
B24501000 0
'''‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/B&gt;&lt;/CODE&gt;&lt;B&gt;&lt;B&gt;&lt;/B&gt;&lt;/B&gt;&lt;/PRE&gt;&lt;P&gt;Then replace the space in the results with a zero or whatever.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To experiment with regular expressions, see: &lt;A href="https://regex101.com/" rel="nofollow noopener noreferrer" target="_blank"&gt;Regular Expressions 101&lt;/A&gt;. This is the explanation given by the website of the expression used in line 12.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;"&lt;B&gt;[\d]+[A-Z][\d]*|&lt;B&gt;[\d]+[\s][\d]*"
gm

1st Alternative &lt;B&gt;[\d]+[A-Z][\d]*
  Match a single character present in the list below &lt;B&gt;
    B matches the character B literally (case sensitive)
  Match a single character present in the list below [\d]+
    + Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed (greedy)
    \d matches a digit (equal to [0-9])
  Match a single character present in the list below [A-Z]
    A-Z a single character in the range between A (index 65) and Z (index 90) (case sensitive)
  Match a single character present in the list below [\d]*
    * Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
    \d matches a digit (equal to [0-9])

2nd Alternative &lt;B&gt;[\d]+[\s][\d]*
  Match a single character present in the list below &lt;B&gt;
    B matches the character B literally (case sensitive)
  Match a single character present in the list below [\d]+
    + Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed (greedy)
    \d matches a digit (equal to [0-9])
  Match a single character present in the list below [\s]
    \s matches any whitespace character (equal to [\r\n\t\f\v ])
  Match a single character present in the list below [\d]*
    * Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
    \d matches a digit (equal to [0-9])

Global pattern flags
  g modifier: global. All matches (don't return after first match)
  m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/B&gt;&lt;/B&gt;&lt;/B&gt;&lt;/B&gt;&lt;/B&gt;&lt;/CODE&gt;&lt;B&gt;&lt;B&gt;&lt;B&gt;&lt;B&gt;&lt;B&gt;&lt;B&gt;&lt;/B&gt;&lt;/B&gt;&lt;/B&gt;&lt;/B&gt;&lt;/B&gt;&lt;/B&gt;&lt;/PRE&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;The following simpler expression also works for the examples in the code above:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;pattern &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; re&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;compile&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"(&lt;B&gt;[\d][\d A-Z]{7,9})"&lt;/B&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍

&lt;SPAN class="comment token"&gt;# Letter B followed by a number, followed by 7 to 9 numbers, spaces, and/or capital letters‍‍‍&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:35:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67462#M5517</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-10T22:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67463#M5518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;CODE&gt;!PojectIinfo!&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/CODE&gt;&lt;CODE&gt;!PojectIinfo!&lt;/CODE&gt;&lt;CODE&gt;&lt;CODE&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;index&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"B"&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/CODE&gt;&lt;CODE&gt;!PojectIinfo!&lt;/CODE&gt;&lt;CODE&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;index&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"B"&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;+&lt;/SPAN&gt;&lt;SPAN class=""&gt;11&lt;/SPAN&gt;&lt;SPAN class=""&gt;]
Yes text field
&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:35:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67463#M5518</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2021-12-10T22:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67464#M5519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I still got the same error on the same line. I checked the field and the lowest count of words in the filed is 2 and a max of 61.&lt;/P&gt;&lt;P&gt;I used len(&lt;CODE&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;CODE&gt;!PojectIinfo!&lt;/CODE&gt;.split(" ")) to get the count of words in that field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2020 18:51:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67464#M5519</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2020-03-10T18:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67465#M5520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Getting closer, the other issue that i found was a lot records didn't have "B", people for got to put the "B" in front of the building permit. Some records have the following. &lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;34567000 0
12345000 0
45125011A0
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:35:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67465#M5520</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2021-12-10T22:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67466#M5521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All I can say is good luck with this. It seems to be getting uglier...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2020 19:10:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67466#M5521</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-03-10T19:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67467#M5522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you aren't going to find a one-script-fits-all solution.&lt;/P&gt;&lt;P&gt;You might have to process and fix in batches... like finding all those records that begin with a "B", then doing those, and finding out how the rest differ.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2020 19:28:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67467#M5522</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-10T19:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67468#M5523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The one constant appears to be an 8-digit number.&amp;nbsp; Assuming that is the case, the following regex should work to extract the 8-digit number plus 2 afterwards:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; l &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"New SFR w/Attached Garage, covered parch and patio B24501000 0"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"B34567000 0 30 X 48 Pole Barn"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NEW 22,778 SQ FT B33561000 0 Addition to existing hop building"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Residential B14356000 0 Storage"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Single Family Res B34561000A0"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"New SFR w/Attached Garage, covered parch and patio B24501000 0 "&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; l&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;   re&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;findall&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"\d{8}[ \w]\d"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; i&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'24501000 0'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'34567000 0'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'33561000 0'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'14356000 0'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'34561000A0'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'24501000 0'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:35:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67468#M5523</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-10T22:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Extract particular values from field</title>
      <link>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67469#M5524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, this got me the closest to my goal. I was trying to understand how re.findall patterns work. The [ ] is used to match certain characters, and the reason you didn't use the [ ]&amp;nbsp; was because you were trying to capture the 8 digits and the last two regardless of the alpha "B". After looking at the data i noticed that some didn't have the "B" but had 8-10 digits. I appreciate the help.&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2020 21:24:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-particular-values-from-field/m-p/67469#M5524</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2020-03-12T21:24:46Z</dc:date>
    </item>
  </channel>
</rss>

