我要找的正則表達式拿到賽爲"HELLO"
和"WORLD"
分別當輸入爲以下任一:用於分割字符串正則表達式
"HELLO", "WORLD"
"HELL"O"", WORLD"
"HELL,O","WORLD"
我已經試過幾個組合,但他們都不來適用於所有場景。
我期待有我的C#代碼是這樣執行的東西:
string pattern = Regex Pattern;
// input here could be any one of the strings given above
foreach (Match match in Regex.Matches(input, pattern))
{
// first iteration would give me Hello
// second iteration would give me World
}
這是一個問題的答案,這是許多程序員的問題,他們回答用戶,但用戶不知道如何添加程序員。我的大腦說「42」。 – GvS 2010-09-16 12:16:26