Would anyone kindly share a .NET regular expression sequence which can extract the text element from an anchor tag.
Example:
<a href="url">I want this</a>
I dont know what the url would be, but I would like to extract the text element from the anchor tag.
-
-
string text = "<a href='url'>I want this</a>";
Regex anchorTextExtractor = new Regex("<a[^>]*>(?'extract' .*?)</a>");
Match m = anchorTextExtractor.Match(text);
if (m.Success)
{
string extract = m.Groups["extract"].Value;
} -
Thanks old boy.
I will check this out when I get home from school
-
Old? Who are you calling old? I'm not old. I'm still hip, I'm still cool. You youngsters have no respect for people like me anymore. When I was younger, we respected people like me.
-
TommyCarlier wrote:Old? Who are you calling old? I'm not old. I'm still hip, I'm still cool. You youngsters have no respect for people like me anymore. When I was younger, we respected people like me.
Ah shove it!
-
I'm warning you! I might call the hair cut police, w-three-bbo!
-
TommyCarlier wrote:Old? Who are you calling old? I'm not old. I'm still hip, I'm still cool. You youngsters have no respect for people like me anymore. When I was younger, we respected people like me.
http://www.urbandictionary.com/define.php?term=old+boy -
i'm totally new to regex, and am having a bit of trouble with getting the regex for this:
[<label class='AHelement' value='Iwantthisvalue'>Some value</label>]
if anyone could help i'd greatly appreciate it!!
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.