C# 中用于在文本中查找匹配项的正则表达式是什么 以“x-[”开头并以“]”结尾?
我试过这样的:
Regex urlRx = new Regex(@"^x-[.*]$", RegexOptions.IgnoreCase);
请您参考如下方法:
简单:
x-\[([^]]+)\]
# that is: look for x-[ literally
# capture and save anything that is not a ]
# followed by ]
C# 中用于在文本中查找匹配项的正则表达式是什么 以“x-[”开头并以“]”结尾?
我试过这样的:
Regex urlRx = new Regex(@"^x-[.*]$", RegexOptions.IgnoreCase);
请您参考如下方法:
简单:
x-\[([^]]+)\]
# that is: look for x-[ literally
# capture and save anything that is not a ]
# followed by ]