RegexOptions options = RegexOptions.None;
        Regex[] r = new Regex[1];
        r[0] = new Regex(@"\[[a-z]+\](\d+)\[[a-z]+\]", options);

        foreach (Match m in r[0].Matches(p_str_Message))
        {

           p_str_Message= p_str_Message.Replace(m.Groups[0].ToString(),"要替換的內容");
                   //m.Groups[0] 代表全匹配
           //m.Groups[1] 代表匹配第一個括號裏的內容
           
        }

相关文章:

  • 2021-09-07
  • 2022-12-23
  • 2021-06-24
  • 2021-12-26
  • 2021-09-29
  • 2021-11-10
  • 2021-12-23
  • 2021-10-25
猜你喜欢
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案