title: How to make a RegEx query only match the whole string?
body: <p>I'm using VBA in Excel 2012 to match the contents in cells to a regular expression, but it's not working.</p>
  
  <p>I'm running the following code:</p>
  
  <pre><code>Dim r1 As New RegExp
  r1.Pattern = "(.)(\s+)?((?:[a-z][a-z]+))(\s+)(\d+)?"
  r1.IgnoreCase = True
  
  For i = 1 To 5
      If r1.Test(Sheet3.Cells.Item(i, 5)) = True Then
          MsgBox ("MATCH: " &amp; Sheet3.Cells.Item(i, 5))
      Else
          MsgBox ("NOT MATCH: " &amp; Sheet3.Cells.Item(i, 5))
      End If
  Next i
  </code></pre>
  
  <p>So it should match the string: "A Person 01"
  But not match: "A Person abc 01"</p>
  
  <p>But it's matching both as the expressin can be found in the second half of the string.
  How do you get it to match the whole string only?
  So only match if the whole contents of the cell is: a single letter, a space, a word, a space, a number</p>
  
  <p>Any help much appreciated!</p>