using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions;namespace ConsoleApplication11 { class Program { static void Main(string[] args) { string str = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 ,16"; Regex re = new Regex(@"(?<!\d)([1-9](?!\d))|(1[1-5](?!\d))"); MatchCollection mc = re.Matches(str); foreach (Match m in mc) { Console.WriteLine(m.Value); } } } }
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;namespace ConsoleApplication11
{
class Program
{
static void Main(string[] args)
{
string str = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 ,16";
Regex re = new Regex(@"(?<!\d)([1-9](?!\d))|(1[1-5](?!\d))");
MatchCollection mc = re.Matches(str);
foreach (Match m in mc)
{
Console.WriteLine(m.Value);
}
}
}
}