title: python - delete line if invalid character
body: <p>I have a 2GB .txt file that has over 60 million lines of what should be MD5 hash values. I've been having problems importing it into a piece of software due to an 'arithmetic error' and so before, I removed any lines that didn't contain 32 characters (to represent the MD5 hash length). Nonetheless, the problem has persisted. </p>
  
  <p>Having reviewed the document manually, some lines don't indeed contain valid hash values. Therefore, I'm looking to read every line and if it contains values other than those between 0-9 and A-F, I'd like the line removed. </p>
  
  <p>I anticipate that Regex may be required but unsure. </p>
  
  <p>I'm just after some pointers on how to implement this string validation? As said, each line should only contain characters between 0-9 and A-F (hexademical).</p>
  
  <p>Thanks in advance</p>