ed2k://|sadasd213213qwewqe`ed2k://sadasdqwewqe213ewr`ed2k://sadasdqwewqe213ewr上面的字符串匹配出多個(gè)以ed2k://開頭的集合,正則該如何寫?
1 回答

鴻蒙傳說(shuō)
TA貢獻(xiàn)1865條經(jīng)驗(yàn) 獲得超7個(gè)贊
static void Main(string[] args) { Regex regx = new Regex("(?=ed2k://)((\\s|.)+?)((?=ed2k://)|$)"); MatchCollection col= regx.Matches("ed2k://|sadasd213213qwewqe`ed2k://sadasdqwewqe213ewr`ed2k://sadasdqwewqe213ewr"); foreach (Match item in col) { Console.WriteLine(item.Value); } Console.WriteLine("end----------------------------------------"); Console.ReadKey(); }
結(jié)果:
- 1 回答
- 0 關(guān)注
- 642 瀏覽
添加回答
舉報(bào)
0/150
提交
取消