using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"RewriteRule ^([d-u]+)-(eu|us)\/faq(?:%25)([\w]+)$ $1-$2\/faq#$4 [R=301,L]";
string input = @"http://broadbandforum.co/offer.php?link=http%3A%2F%2Fwww.youtube.com%2Fattribution_link%3Fa%3DfF1CWYwxCQ4%26u%3D%2Fwatch%253Fv%253DqYr8opTPSaQ%2526feature%253Dem-uploademail";
foreach (Match m in Regex.Matches(input, pattern))
{
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