using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^.*\s+(\d+)\s(\d+)\s(.*)$";
string input = @"drwxr-xr-x 1 saulo 197609 0 1643302767 img
-rwxr-xr-x 1 saulo 197609 814 1646247422 folder_files.sh
-rw-r--r-- 1 saulo 197609 2962 1646247491 README.md
-rwxr-xr-x 1 saulo 197609 59 1654780176 gitp
drwxr-xr-x 1 saulo 197609 0 1654780219 pessoal
-rwxr-xr-x 1 saulo 197609 1022 1654780442 folder_files.py
-rw-r--r-- 1 saulo 197609 226 1654781546 folder_files.php";
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