title: Search for a partial string in a list of strings
body: <p>I have a list of strings looking like this:</p>
  <pre><code>['MEASUREMENT   K02313  New York',\
   'MEASUREMENT   K02338  London [BC:2.7.7.7]',\
   'MEASUREMENT   K14761  Kairo [BC:1.2.-.-]',\
   'MEASUREMENT   K03629  Berlin',\
   'MEASUREMENT   K02470  Paris [BC:5.6.2.-]',\
   'MEASUREMENT   K02469  Madrid [BC:5.43.2.2]',\
  ....]
  </code></pre>
  <p>As you can see some elements in the list have a string with the format <strong>BC:x.x.x.x</strong>, with x either being a number from 0-999 or a hyphen (&quot;-&quot;).<br />
  Now I want to get a seperate list that has all of these BC:x.x.x.x elements saved.<br />
  I tried using a regular expression:</p>
  <pre><code>re.findall(r&quot;BC:([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|-).([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|-).([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|-).([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|-)&quot;, list_name)
  </code></pre>
  <p>but it doesn't work, I get the following error message:</p>
  <pre><code>TypeError: expected string or bytes-like object
  </code></pre>