using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?i)^(Where|How|Is|Does|I wanna|I want|I wish)\b.*\bdemo( game| version( of the game)?)?( exist| available| out there)?(\.|\?|!)*?$";
string input = @"How can I download the demo
Where get demo?!?!
where is the demo version of the game?
How do I get the demo game!
Anyone know how to get the demo?
How does one download a geneshit
so I was wondering, how do we get more newbies to play the demo
Does a demo version of the game exist?!?!?
Is a demo version of the game available
is a demo version of the game out there
Is there a demo version?
I wish there was a demo version
is a demo out there?";
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