0
例如,我有一個模式,我正在尋找使用\ G選項,因此它會記住它的最後一次搜索。我希望能在.NET C#重用這些(即:保存匹配到一個集合)有沒有辦法讓在RegEx.Replace中使用的變量在.NET中使用?
例如:
string pattern = @"\G<test:Some\s.*";
string id = RegEx.Match(orig, pattern).Value;
// The guy above has 3 matches and i want to save all three into a generic list
我希望這是明確的,我可以,如果沒有詳細說明。
感謝:-)
非常感謝你,我想這一點,但沒有運氣 - 當我使用RegEx.Match(原稿,圖案)它的工作原理,如果我這樣做: MatchCollection CO = RegEx.Matches(原稿,圖案); 我收到0結果。任何想法在這裏做錯了什麼? – schmoopy 2009-07-23 18:58:53