I don't believe the submatch and names array can ever be a different length.  The code originally came from Ben's regex helper and I wasn't sure if hit some condition where that wasn't true so I left it.