I have the below code splitting a string on a regex:
string s = "test;3 régred";
string[] authorsList = Regex.Split(s, "(\\s+)|([\\p{P}\\p{S}])");
foreach (string q in authorsList)
{
Console.WriteLine(q);
}
It's supposed to be splitting and keeping only:
test
3
régred
But it's storing
test
;
3
*space*
régred
Why is it not losing the delimiters?