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# - C# 中的正则表达式查找类似 "x-[some_string]"的匹配项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36450282/