title: Find id from CSV using Regex
body: <p>I was given a .csv that contains two columns: <code>Name</code> and <code>description</code>. For each row within the <code>description</code> column, I am trying to find specific text. It looks like html or xml format and I was thinking about using the <code>Elemental Tree XML</code> library, but there are no indentations. Everything is a new line, so I felt that using <code>Regex</code> would be the simplest approach. Below is one of the rows. I put <code>#</code> in because I am not sure if the information is sensitive or not. About half way down there is a <code>td</code> tag that contains some letters and numbers (F00Y009). This is the information I am trying to grab and essentially put in another column. I haven't used the <code>Regex</code> library much and would appreciate some assistance.</p>
  <p>This is what I have so far, but I don't quite understand how to say &quot;search for text that starts with &lt; td &gt; contains capital letters and numbers and ends with with &lt; /td &gt; (disregard &quot; &quot; after &lt;, stack wont let me do &lt;&gt; with something in-between).</p>
  <pre><code>import pandas
  import re
  
  col_list = [&quot;Name&quot;, &quot;description&quot;]
  df = pandas.read_csv(path to csv)
  id = df[&quot;description&quot;][0]
  match = re.search(&quot;^&lt;td&gt;[A-Z0-9]&lt;/td&gt;$&quot;, id)
  print(match)
  </code></pre>
  <p>output:</p>
  <pre><code>[]
  </code></pre>
  <p>First row within &quot;description&quot; column:</p>
  <pre><code>&lt;html ########&gt;
  
  &lt;head&gt;
  
  &lt;META ########&gt;
  
  &lt;meta ########&gt;
  
  &lt;/head&gt;
  
  &lt;body style=&quot;########&quot;&gt;
  
  &lt;table style=&quot;########&quot;&gt;
  
  &lt;tr style=&quot;########&quot;&gt;
  
  &lt;td&gt;########&lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;tr&gt;
  
  &lt;td&gt;
  
  &lt;########&gt;
  
  &lt;tr&gt;
  
  &lt;td&gt;########&lt;/td&gt;
  
  &lt;td&gt;########&lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;tr bgcolor=&quot;#########&quot;&gt;
  
  &lt;td&gt;########&lt;/td&gt;
  
  &lt;td&gt;########&lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;tr&gt;
  
  &lt;td&gt;########&lt;/td&gt;
  
  &lt;td&gt;########&lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;tr bgcolor=&quot;#########&quot;&gt;
  
  &lt;td&gt;########&lt;/td&gt;
  
  &lt;td&gt;F00Y009&lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;tr&gt;
  
  &lt;td&gt;SHAPE&lt;/td&gt;
  
  &lt;td&gt;Point&lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;tr bgcolor=&quot;######&quot;&gt;
  
  &lt;td&gt;########&lt;/td&gt;
  
  &lt;td&gt;########&lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;tr&gt;
  
  &lt;td&gt;########&lt;/td&gt;
  
  &lt;td&gt;########&lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;tr bgcolor=&quot;#######&quot;&gt;
  
  &lt;td&gt;########&lt;/td&gt;
  
  &lt;td&gt;#######&lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;tr&gt;
  
  &lt;td&gt;########&lt;/td&gt;
  
  &lt;td&gt;{########}&lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;/table&gt;
  
  &lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;/table&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  
  </code></pre>
  <p>desired output:</p>
  <pre><code>&lt;td&gt;F00Y009&lt;/td&gt;
  </code></pre>