-3
例如使用正则表达式表达德尔(。*?)德尔得到delcatdel 并将结果保存在字符串或文本如何在正则表达式中获得第一个匹配并将该匹配导入到字符串中?
word1word2 delcatdel word3word4 deldogdel的word5
在我的文字(或字符串),我需要获得delcatdel
用C尖锐
请人帮助我
例如使用正则表达式表达德尔(。*?)德尔得到delcatdel 并将结果保存在字符串或文本如何在正则表达式中获得第一个匹配并将该匹配导入到字符串中?
word1word2 delcatdel word3word4 deldogdel的word5
在我的文字(或字符串),我需要获得delcatdel
用C尖锐
请人帮助我
var regex = new Regex("del(.*?)del");
var match = regex.Match("word1word2delcatdelword3word4deldogdelword5");
string matched = match.Value;
非常感谢你。 – pabloflinstone
使用'Regex.Match' –
有155982点正则表达式的问题。没有人帮助你吗? –
我没有找到类似的答案,我有点困惑 – pabloflinstone