using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(http(s)?:\/\/)?(.*\\.)?partselect.com\/PS.*(htm|html)((?!Page=\d{1,3}#Central_Content_PagerTop).)*$";
string input = @"https://www.partselect.com/PS11741913-Whirlpool-WP37001042-Drum-Support-Roller-for-square-ported-models.htm?Page=0#Central_Content_PagerTop
https://www.partselect.com/PS4138718-Samsung-DA34-00006C-Light-Door-Switch.htm?SourceCode=19&SearchTerm=&ModelNum=BBF19KASWXAC
https://www.partselect.com/PS9172714-MTD-954-04032B-Belt-3L-X-35-80.htm?SourceCode=18";
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