I have a problem to this html code.I want to get only the data inside the href,but the data is dynamic.

<a title="Click here to see docket information" href="/ccm/do/docket?county=65&amp;data=eedd78d10fd9da341e05b25b48b62013">652012CC000006CCXXXX</a>

I am not really familiar in regex.I am using this code to extract the html inside the href.

 MatchCollection m1 = Regex.Matches(response,@"(href=.*?>.*?</a>)",

string caseID = "";
foreach (Match m in m1)
    string value = m.Groups[1].Value;


But it returns


instead this


I need your suggestion.

Recommended Answers

All 3 Replies


Will match


Very useful regex builder

Thanks for the reply, but i solved the problem by using this regex pattern


hope that will help to others.

That's also fine, mine was written the way it is as you said the HREF was dynamic and so mine covered all bases.

Don't for get to mark the thread as solved if your issue is fixed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.