using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"href=""(\w[^""]+\/pdf4v\/\w[^""]+)";
string input = @"<ul>
<li><a href=""#"" id=""fav"" onclick=""return favoritesadd(8094,'fav.png','removefav.png');""><img id=""fav8094"" src=""fav.png"" alt="" border=""0"" /> <span id=""fav8094"">ADD TO WISHLIST</span></a></li>
<li class=""sixcol right""><a href=""https://documents.domain.com/content/updates/year18/jv/folder01/pdf/pdf8094.zip?exp=1567791065&hsh=5a49e7d4828603beddbfb058a1535f5e&dl=att&filename=pdf-00008094-16.pdf"" class=""tcenter""><img src=""pdf.png"" class=""icon"" align=""left"" />16<br /><span class=""small"">download pdf</span></a></li>
<li class=""sixcol""><a href=""https://documents.domain.com/content/updates/year18/jv/folder01/pdf4v/pdf4v8094.zip?exp=1567791065&hsh=246a7702296f7db363ecaa1746a8815a&dl=att&filename=pdf-00008094-40.pdf"" class=""tcenter""><img src=""pdf.png"" class=""icon"" align=""left"" />40<br /><span class=""small"">download pdf</span></a></li>
<div class=""clear""></div>
<li><a href=""/details.php?id=8094&num=1&ss=1"" onclick=""$.open();return false;""><img src=""/images/details.png"" class=""center"" />Details</a></li>
</ul>";
RegexOptions options = RegexOptions.Multiline;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx