I was trying to find some parse code for an html table and came across this one:
But I need it in vb.net, so I used a popular converter and everything but the following two functions seems to have come over properly...
Any idea how to correct these two hiccups?
New is underlined " ')' expected" (although that was after I added a space after headerMatches)
Private Shared Function ParseColumns(tableHtml As String) As DataColumn()
Dim headerMatches As MatchCollection = Regex.Matches(tableHtml, HeaderPattern, ExpressionOptions)
Return (From headerMatch In headerMatchesNew DataColumn(headerMatch.Groups(1).ToString())).ToArray()
New is underlined " ')' expected"
''' For tables which do not specify header cells we must generate DataColumns based on the number
''' of cells in a row (we assume all rows have the same number of cells).
''' <param name="rowMatches">A collection of all the rows in the HTML table we wish to generate columns for</param>
''' <returns>A set of DataColumns based on the number of celss in the first row of the input HTML table</returns>
Private Shared Function GenerateColumns(rowMatches As MatchCollection) As DataColumn()
Dim columnCount As Integer = Regex.Matches(rowMatches(0).ToString(), CellPattern, ExpressionOptions).Count
Return (From index In Enumerable.Range(0, columnCount)New DataColumn("Column " & Convert.ToString(index))).ToArray()