I have some long HTML text, something like this:
/*stuff*/
<a href="some/link.html">Link</a>
/*stuff*/
How can I crop this so that I get only the some/link.html
text?
I have some long HTML text, something like this:
/*stuff*/
<a href="some/link.html">Link</a>
/*stuff*/
How can I crop this so that I get only the some/link.html
text?
MatchCollection matches = Regex.Matches(html, @"(?<=<a\s+href="").*?(?="">)");
should do the trick.
Note that I am using the pattern (?<=prefix)find(?=suffix)
with:
prefix = <a\s+href="
find = .*?
suffix = ">
using jquery you can do the following:
var pageNum = $("a#specificLink").attr("href").match(/page=([0-9]+)/)[1];
and in .net c# this tutorial might guide you in the right direction.