title: RegEx in Outlook VBA to get text from Email Body
body: <p>I need to extract text from an email body using a RegEx. I'm using Outlook 2010 with the MS VBScript 5.5 regex engine. The text i'm trying to extract is:</p>
  
  <pre><code>MessageID                              :1079247881
  InstrumentID                         :DS5431460001
  </code></pre>
  
  <p>So far, I've come up with:</p>
  
  <pre><code>MessageID\s*\:(\d+)\n
  InstrumentID\s+\:([a-z]{2}\d+)\n
  </code></pre>
  
  <p>Both are working now. Here are my tests: </p>
  
  <p><a href="https://regex101.com/r/bX3lJ9/5" rel="nofollow">InstrumentID</a> </p>
  
  <p><a href="https://regex101.com/r/bX3lJ9/6" rel="nofollow">MessageID</a></p>
  
  <p>Ultimately, I want to highlight a specific message and run my code. It will then extract those 2 items from that message and put them into a template for me to send. I'm doing ok on that part. I just need help with the RegExs. </p>