title: Regular expression for hexadecimal string in python not working
body: <p>I have a regular expression to match strings like:</p>
  <blockquote>
  <p>--D2CBA65440D</p>
  <p>--77094A27E09</p>
  <p>--77094A27E</p>
  <p>--770</p>
  <p>--77094A27E09--</p>
  </blockquote>
  <p>basically, it matches a hexadecimal string surrounded by one or more line breaks or white space, and has the prefix -- and may or may not have -- as suffix</p>
  <p>i use the following python code, and it works fine most of the time:</p>
  <pre><code>hexaPattern = &quot;\s--[0-9a-fA-F]+[--]?\s&quot;
  hex = re.search(hexaPattern, part)
  if hex:
     print &quot;found a match&quot;
  </code></pre>
  <p>this works for all of the above but it doesn't match --77094A27E09 in this block:</p>
  <pre><code>&lt;div id=&quot;arrow2&quot; class=&quot;headerLinksImg&quot; style=&quot;display:block
  
  --77094A27E09
  
  ;&quot;&gt;
  </code></pre>
  <p>but matches the same string in:</p>
  <pre><code>&lt;input type=&quot;checkbox&quot; name=&quot;checkbox&quot; id=&quot;checkboxKG3&quot; class
  
  --77094A27E09
  
  Content-T=&quot;checkboxKG&quot; value=&quot;KG3&quot; /&gt;
  </code></pre>
  <p>What am i doing wrong?</p>