different regex:

vb Code:
  1. Dim rx As New Regex("(?<=Dim\s).+?(?=\b)")

it'll return local variables + arrays