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#
Living as an expatriate in Riyadh, Saudi Arabia. Belongs from Karachi, Pakistan. Working as Sr Software Engineer