命名空间:
using System.Text.RegularExpressions;
使用正则表达式去除富文本中的字体设置内容:
Regex regex = new Regex("<.*?>", RegexOptions.Compiled);
string content = regex.Replace(txShow.text, string.Empty);
使用正则表达式查找内容并替换成想要的内容格式
例如:把“99%”改为“百分之99”
Regex.Replace(content, "([0-9]*)(%)", "百分之$1");