string ptrn = "<a href='[^']+'>[^<]+</a>"; //<a href="http://[^"]+">([^<]+)</a> use that as wellstring strToCompare = "xyrsdsfdfshfds<a>sdjsgdjgsjdsd</a>yutrsgdhdg abcd yhsgjhgshdg<a href='yahoo.com'>xyz</a>";Regex objRegex = new Regex(ptrn);if (objRegex.IsMatch(strToCompare)){Response.Write(objRegex.Matches(strToCompare)[0].Value);// I am using this .. you can iterate in array and read all the values}
Tags: Regex-matching
.net | c#
Related posts
Comments
Add comment
Try, Strive and Struggle are the keys of my hope. When there is no hope, no success. So keep hoping and keep winning. No idea how true that statement is, as I myself is losing the biggest hope of mine. So do it on your own risk :)