title: VBScript RegEx - Find block of data between a pattern
body: <p>I am trying to use RegEx to get blocks of data from a multi-line string.</p>
  
  <p><strong>String to search</strong></p>
  
  <pre>
  ***** a.txt
  17=xxx
  570=N
  55=yyy
  ***** b.TXT
  17=XXX
  570=Y
  55=yyy
  *****
  
  ***** a.txt
  38=10500.000000
  711=1
  311=0000000006630265
  ***** b.TXT
  38=10500.000000
  311=0000000006630265
  *****
  </pre>
  
  <p><strong>What I need</strong> - anything between ***** block</p>
  
  <pre>
  17=xxx
  570=N
  55=yyy
  
  17=XXX
  570=Y
  55=yyy
  
  38=10500.000000
  711=1
  311=0000000006630265
  
  38=10500.000000
  311=0000000006630265
  </pre>
  
  <p><strong>My code so far</strong></p>
  
  <pre>
  Set objRegEx = CreateObject("VBScript.RegExp")
  objRegEx.Global = True
  objRegEx.MultiLine = True
  objRegEx.IgnoreCase = True
  objRegEx.Pattern = "\*\*\*\*\*(?:.|\n|\r)*?\*\*\*\*\*"
  Set strMatches = objRegEx.Execute(objExec.StdOut.ReadAll())
  If strMatches.Count > 0 Then
      For Each strMatch In strMatches
          Wscript.Echo strMatch
      Next
  End If
  Set objRegEx = Nothing
  </pre>