Reputation: 3120
I have this "-6--15" and I want to split this into -6 and -15.
Here is my code in C#:
string[] groups = Regex.Split("-6--15",@"\d+\-{1}");
But it returns - and -15.
Help!
Upvotes: 0
Views: 921
Reputation: 12797
Use the following:
string[] groups = Regex.Split("-6--15", @"(?<=\d)-");
Explanation:
(?<=\d)-
Upvotes: 5