using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^(Primary|Secondary|Tertiary).Gene:.([A-Z]|[a-z])+ \(1\)";
string input = @"1([A-Z]|[a-z])+
Scroll of Renaming (1)
Seller: Rogrinus
Expires in: 07 hr, 09 min, 46 sec
Selling price:
200000
1
Secondary Gene: Loop (Veilspun) (1)
Seller: Natta
Expires in: 09 hr, 21 min, 47 sec
Selling price:
200000
1
Primary Gene: Python (1)
Seller: PlatinumStardust
Expires in: 1 days, 07 hr, 37 min, 50 sec
Selling price:
200000
1
Primary Gene: Stitched (Veilspun) (1)
Seller: lizagem
Expires in: 2 days, 11 hr, 07 min, 56 sec
Selling price:
200000
1
Primary Gene: Stitched (Veilspun) (1)
Seller: ScarletCyanide
Expires in: 3 days, 06 hr, 31 min, 26 sec
Selling price:
200000
1
Tertiary Gene: Capsule (Veilspun) (1)
Seller: forcipiger
Expires in: 4 days, 04 hr, 15 min, 26 sec
Selling price:
200000
1
Tertiary Gene: Firefly (Veilspun) (1)
Seller: Pyracantha
Expires in: 4 days, 23 hr, 35 min, 53 sec
Selling price:
200000
1
Primary Gene: Python (1)
Seller: sisyo
Expires in: 5 days, 13 hr, 59 min, 20 sec
Selling price:
200000
1
Tertiary Gene: Squiggle (Banescale) (1)
Seller: BananaMeteor
Expires in: 5 days, 18 hr, 32 min, 31 sec
Selling price:
200000
1
Primary Gene: Skink (1)
Seller: H0ur
Expires in: 6 days, 13 hr, 07 min, 31 sec
Selling price:
200000
";
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