title: Extract strings of length 32 characters
body: <p>I'm parsing an email body to extract strings of length 32 characters (MD5 hashes). I'm getting matches on strings of more than 32 characters as well and I can't tweak the regex to get it working.</p>
  
  <pre><code>Sub GetValueUsingRegEx()
  
      Dim olMail As Outlook.MailItem
      Dim Reg1 As RegExp
      Dim M1 As MatchCollection
      Dim M As Match
      Dim pat As String
  
      Set olMail = Application.ActiveExplorer().Selection(1)
      'Debug.Print olMail.Body
  
      pat = "[a-fA-F0-9]{32}"
      Call parseTheEmail(pat, olMail)
  
  End Sub
  
  Sub parseTheEmail(ByVal pat As String, ByVal email As Outlook.MailItem)
      Set Reg1 = New RegExp
      With Reg1
          .pattern = pat
          .Global = True
          .IgnoreCase = True
      End With
      If Reg1.Test(email.Body) Then
  
          Set M1 = Reg1.Execute(email.Body)
          For Each M In M1
              Debug.Print M
          Next
      End If
  
  End Sub
  </code></pre>