Here is my regex:
href\\s*=\\s*(?:\"(?<1>[^\"]*)\"|(?<1>\\S+))
And here is what I have:
"<p>dfhdfh</p>\r\n<p><a href=\"/Content/blabla/345/344\">najnov</a></p>\r\n<p> </p>\r\n<p><a href=\"/Content/blabla/345/323:test 1\">test 1 </a></p>"
But m.Groups are:
{href="/Content/blabla/345/344"}
{/Content/blabla/345/344}
How to get the second href in m?
Here is my code:
Match m = Regex.Match(myString, "href\\s*=\\s*(?:\"(?<1>[^\"]*)\"|(?<1>\\S+))", RegexOptions.IgnoreCase);
if (m.Success)
{
for (int ij = 0; ij < m.Groups.Count; ij++)
myString = myString.Replace(m.Groups[ij].Value.Substring(7), m.Groups[ij].Value.Substring(m.Groups[ij].Value.LastIndexOf("/") + 1));
}