Previous information: I'm making an application in which I copy part of the code of a web page (from a table of this to be exact) in order to put the information of this in a database. For that, he had thought about dividing the chain that the user hits in textbox
in a array
to then go putting the data with a loop. The fact is that I am not able to find the regular expression that "eliminates" everything that is between <>
to divide it.
I give you an example of the string that the user would enter:
<tbody><tr id="timetableBlocks-23-01-18" style="display: block;"><td style="width: 135px;">23/01/2018</td><td style="width: 135px;">759.655</td><td style="width: 135px;">46.705</td><td style="width: 135px;">42.724</td><td style="width: 135px;">224.863</td><td style="width: 135px;">76.364</td><td style="width: 135px;">171.784</td><td style="width: 135px;">0</td><td style="width: 135px;">197.215</td></tr><tr id="timetableBlocks-22-01-18" style="display: block;"><td style="width: 135px;">22/01/2018</td><td style="width: 135px;">553.995</td><td style="width: 135px;">42.573</td><td style="width: 135px;">194.736</td><td style="width: 135px;">26.671</td><td style="width: 135px;">221.950</td><td style="width: 135px;">13.780</td><td style="width: 135px;">0</td><td style="width: 135px;">54.285</td></tr></tbody>
Then the objective would be, so to speak, to eliminate the html tags and to remain alone with what they are enclosed. The code that I used is the following:
Dim DatosBruto As String = TextBox1.Text
If DatosBruto Like "<tbody>*</tbody>" Then
Label7.Text = "ha introducido bien los datos"
Dim pattern As String = "(<*>)" //<-- aquí es donde no funciona
Dim DatosPartido() As String = Regex.Split(DatosBruto, pattern, RegexOptions.IgnoreCase)
Label1.Text = DatosPartido(1)
Label2.Text = DatosPartido(2)
Label3.Text = DatosPartido(3)
Label4.Text = DatosPartido(4)
Label5.Text = DatosPartido(5)
Label6.Text = DatosPartido(6)
The regular expression that is set is because it was the last one I've tried, but obviously it does not work, can you think of how it could be?
Currently the data that I get does not make sense (go, which separates where you want), for now I'm putting them in label
until I get what I want. The goal would be to get something like
label1 = 23/01/2018,
label2 = 759.655,
label3 = 46.705,
label4 = 42.724,
label5 = 224.863,
label6 = 76.364
...