x Hint: Register, if you want to hide ads.
x Did you like it? Well, then please consider making a donation :)

Regex Tag - split

Split string to get Date and text

I have to process text file like that: text 01/01/1970 text 02/01/1970 ... etc. I want the output to be the following data: 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.

Type: split, Date: 8/12/2015 4:38:43 PMAuthor: stackoverflow

Simple Regex.Split sample - remove digits

User \d+ for remove digits and \D+ for remove text.

Type: split, Date: 3/30/2015 12:45:18 AMAuthor: admin