I'm using Regex to parse HTML:
private void button2_Click(object sender, EventArgs e)
{
string html = textBox1.Text;
foreach (Match matcha in Regex.Matches(html, @"<(.*?)>(.*?)</(.*?)>"))
{
listBox1.Items.Add(matcha.Index.ToString() + matcha);
}
foreach (Match matchb in Regex.Matches(html, @"<input type=(.*?)>"))
{
listBox1.Items.Add(matchb.Index.ToString() + matchb);
}}
When button2
pressed, listbox1
has the following items:
25...
29...
27...
I want to expected Output
25...
27...
29...
What should I do?