Hi Guys,
I can't think of a better way to do this, what i have is this function:
vb.net Code:
Function functionDealWithHiddenFields(ByVal HTML As String, ByVal numHiddenFields As Integer) Try '// The html source Dim sText = HTML '// The string we are searching for Dim sPattern As String = "(?<=<input type=""hidden"" class="").*?(?="".*?')" '// This is the regular expression Dim regex As New Regex(sPattern, RegexOptions.IgnoreCase Or RegexOptions.Singleline) '// The matches that we return are put in the matchcollection Dim regexMatches As MatchCollection = regex.Matches(sText) '// Return 'Return regexMatches(0).ToString For x As Integer = 0 To numHiddenFields MessageBox.Show(regexMatches(x).ToString) Next Catch ex As Exception 'Return False Return False End Try End Function
I feed in afew parameters, one beingwhich 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 themPHP Code:numHiddenFields
i'm probably doing something basic lol
any help would be great
thanks guys
Graham




Reply With Quote