我想要子字符串,如果他們有一定的格式。子串正則表達式查詢是[CENAOD(xyx)]
。我已經完成了下面的代碼,但是在循環中運行它時,它表示所有結果都匹配哪個是錯誤的。我在哪裏做錯了什麼?正則表達式接受所有字符串,wronly
string strRegex = @"(\[CENAOD\((\S|\W)*\)\])*";
string strCenaOd = sReader["intro"].ToString()
if (Regex.IsMatch(strCenaOd, strRegex, RegexOptions.IgnoreCase))
{
string = (want to read content of () = xyz in example)
}