1
我在構建c#中的正則表達式時遇到了一些麻煩。查找以另一個字符串開頭的字符串中的所有命名組發生
例如,我有一堆字符串:
1: TestString.WrittenEspecially.ForStackOverflowStringTest
2: TestString.WrittenEspecially.ForStackOverflowString
3: TestString.WrittenEspecially.StringForStackOverflowStringTest
4: TestString.WrittenStringEspecially.ForStackOverflowStringTest
我想找到的單詞「字符串」所有出現在開頭爲「1」或「3」。
我有一個正則表達式:^(1:|3:).*(?<str>String)+.*
但它發現只有一個名爲組的最後出現。
任何想法?