I want to extract all values from the text line below using regular expressions:
(Sales (Type 0 0 0 0 000 0 0 0 0) "Product" "ProductType" "" "0000" "0000") ;;ProductName 000
How to write regular expression for this? am using C#.
am using the following code to read the text file
string expr = @"^\(Sales \(Type \d \d((?: \d+){7})\) "([^"]+)" "([^"]+)" "" "(\d+)" "(\d+)"
";
Regex regex = new Regex(expr);
using (StreamReader r = new StreamReader(@"C:\records.log"))
{
while ((line = r.ReadLine()) != null)
{
foreach (Match m in regex.Matches(line))
{
string value = m.Value.Trim();
MessageBox.Show(value);
}
}
}
is it right? but i cant get the value