I have to process text file like that:
2010-04-02
...
...
...
2010-05-01
...
...
...
It is possible to get values by using Split function:
Regex.Split(text, @"\d{4}-\d{2}-\d{2}")
Is there way to get dates and related text below the date?
My output should be array of items (date, text).
Thanks
According to the docs, wrapping the string you’re splitting on in () (making it a capture group) will result in these captures being included in the array.
Regex.Split(text, @"(\d{4}-\d{2}-\d{2})")