using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^[\w\s./-]*(?:\s\d+){4}(?:\s\$\d+\.\d+){2}$";
string input = @"Amount
2144-PL
1XL 2XL 3XL
2144-
PL Navy Blue 2 2 2 6 $11.50 $69.00
ETK-2097K-PL PLUS-TOP - BACK BUTTON TUNICS 95% RAYON 5% SPANDEX MADE IN USA
1XL 2XL 3XL
Black 2 2 2 6 $12.00 $72.00
Teal 2 2 2 6 $12.00 $72.00
ETK-2197-SW-
1XL 2XL 3XL
PL ETK-
2197- H.Grey/Burgu… 2 2 2 6 $14.00 $84.00
Off-White/Black 1 1 1 3 $14.00 $42.00
ETK-2143 Tops - 95% RAYON 5% SPANDEX MADE IN USA
S M L
Heather Grey 2 2 2 6 $10.50 $63.00
Royal Blue 2 2 2 6 $10.50 $63.00
Ruby Red 2 2 2 6 $10.50 $63.00
ETK2186-GD- Tops-Stripe Solid-95% Rayon 5% Spandex Made in USA
PL
1XL 2XL 3XL
Burgundy/Bur… 2 2 2 6 $11.00 $66.00
Ivory/Black 2 2 2 6 $11.00 $66.00
2139 - WP-PL PLUS TOP -95% RAYON 5% SPANDEX MADE IN USA
1XL 2XL 3XL
As Shown 2 2 2 6 $9.50 $57.00
ETK-2228
S M L
ETK-
2228 Off-White/Black 2 2 2 6 $9.50 $57.00
ETK-2149-PL
1XL 2XL 3XL
ETK-
2149- Taupe 2 2 2 6 $11.50 $69.00
BACK
ORDERED
White 2 2 2 6 $11.50 $69.00
Sub";
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