i'm trying to get a particular part of an HMTL-source
i've the whole HTML source-code stored in a variable myHTML
i've a searchword stored in a variable myTitle
now i want to get all parts of html that match with myTitle and so get an url:
But my regex doesn't work as well
Someone sees my faults?
CODE SNIPPET
*******************
Dim myExpression As String = "<a .+? (href=['""]) [^>]*? \> *mytitle* <\a>"
Dim regex As New Regex(myExpression, RegexOptions.IgnoreCase)
Dim mt As Match
Dim gp As Group
mt = regex.Match(myHTML)
For Each gp In mt.Groups
TextBox1.Text += gp.Value & "....."
Next
WHAT DO I WANT:
***********************
for example: this is a part of myHTML
- <a href="s/sexandlucia.php">Sex and Lucia</a> (2002)<br>
- <a href="s/sexiscomedy.php">Sex is Comedy</a> (2003)<br>
- <a href="../movies/s/sexybeast.php">Sexy Beast</a> (2001)<br>
- <a href="../movies/s/shadowglories.php">Shadow Glories</a>
(2001)<br>
- <a href="s/shadowofvampire.php">Shadow of the Vampire</a>
(2000)<br>
- <a href="s/shaft.php">Shaft</a> (2000)<br>
- <a href="../movies/s/shallowhal.php">Shallow Hal</a> (2001)<br>
- <a href="s/shaolinsoccer.php">Shaolin Soccer</a> (2003)<br>
- <a href="s/shanghaighetto.php">Shanghai Ghetto</a> (2002)<br>
- <a href="s/shanghaiknights.php">Shanghai Knights</a> (2003)<br>
- <a href="s/shapeofthings.php">The Shape of Things</a> (2003)<br>
- <a href="s/sharkslayer.php">Sharkslayer</a> (2004)<br>
- <a href="s/shatteredglass.php">Shattered Glass</a> (2003)<br>
- <a href="../movies/s/shippingnews.php">The Shipping News</a>
(2001)<br>
- <a href="../movies/s/shotatglory.php">A Shot at Glory</a>
(2001)<br>
- <a href="../movies/s/showtime.php">Showtime</a> (2002)<br>
- <a href="../movies/s/shrek.php">Shrek</a> (2001)<br>
- <a href="../movies/s/shrek2.php">Shrek2</a> (2001)<br>
i want to get the link of: shrek - <a href="../movies/s/shrek.php">Shrek</a>
(2001)<br>
So myTitle is in that case = Shrek