Hi Guys,

I can't think of a better way to do this, what i have is this function:

vb.net Code:
  1. Function functionDealWithHiddenFields(ByVal HTML As String, ByVal numHiddenFields As Integer)
  2.  
  3.         Try
  4.  
  5.             '// The html source
  6.             Dim sText = HTML
  7.  
  8.             '// The string we are searching for
  9.             Dim sPattern As String = "(?<=<input type=""hidden"" class="").*?(?="".*?')"
  10.  
  11.             '// This is the regular expression
  12.             Dim regex As New Regex(sPattern, RegexOptions.IgnoreCase Or RegexOptions.Singleline)
  13.  
  14.             '// The matches that we return are put in the matchcollection
  15.             Dim regexMatches As MatchCollection = regex.Matches(sText)
  16.  
  17.             '// Return
  18.             'Return regexMatches(0).ToString
  19.             For x As Integer = 0 To numHiddenFields
  20.                 MessageBox.Show(regexMatches(x).ToString)
  21.             Next
  22.  
  23.         Catch ex As Exception
  24.  
  25.             'Return False
  26.  
  27.             Return False
  28.  
  29.         End Try
  30.  
  31.     End Function

I feed in afew parameters, one being
PHP Code:
numHiddenFields 
which usually contains: 4 so when i loop out the names, it loops the 4 results, 4 times, instead of just showing me the names 4 times so i can then store them

i'm probably doing something basic lol

any help would be great

thanks guys

Graham