using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"structure|(constant\s+?maturity\s+?|CMS|CMT)|inverse\s+?floater|snow\w+|steepener|flattener|(digital|callable|accrual|CRANS)|(variance|volatility)|quanto|trigger";
string input = @"• Anything with “Structured Note”
• Anything with “Constant Maturity swap” or “CMS” (i.e., “CMS” or “CMS option”)
• Anything with “Constant Maturity Treasuries” or “CMT” (i.e., “CMT swaps or CMT swaptions”)
• Anything with “Inverse floater” inverse floater
• Anything with “Snowball”
• Anything with “Steepener”
• Anything with “Flattener”
• Anything with “Digital and Callable Range Accrual Notes” (“CRANS”)
• Anything with “Variance” or “Volatility” in connection with “swap”
• Anything describing a “Quanto” swap or swaption
• Anything describing a “Trigger” swap or swaption
";
RegexOptions options = RegexOptions.Multiline | 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