using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"[^\n.!?:]*(?:thanks|thank[ -]you|(?:please|plz|h[ea]l?p|suggest(?:ions)|th?anks|thx|tanx|could)\b[^\n.!?:]*\b(?:h[ea]lp|ap+reciat\w*|me|advan\w*|a ?lot)\b[^\n.!?:]*)[.!?]*[ ]*";
string input = @"I don't know what's going on. Any help would be appreciated. How can I do this?
Any suggestions are appreciated :)
Please help me, i will thank you. How I do this?
I hope you guys can help me. Thanks for any help.
All suggestions are appreciated, thanks
Thanks in advance.
Could you hep me?
I hope you can plz help me buddy!
please halp
Can someone plz guide me where I am going wrong ?
I have no teacher or any instructor because I am learning programming on my own, so please any help is appreciated. Thanks
tanx in advance!
tanks in advance!
Thanks in advance!
kindly help me with the step by step solution.. thanks in advance
__Thanks in advance.__
Thanks a lot!
Thank you!!!
also id like to thank you for any help in advance. let me first state that i am aware of possible security issues and will address those accordingly.
thanks!!
Do Not Match:
Software for tanks. It would please my boss.
Please look at this example.
Thanks to Microsoft, I can no longer log in to my email.
";
RegexOptions options = RegexOptions.IgnoreCase;
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