【发布时间】:2019-09-16 17:53:57
【问题描述】:
我从查询中得到 3 种字符串:
**TYPE1 :**["type1"]
**TYPE2 :**["type2 type2 type2"]
**TYPE3 :**["type3 type3"]
我写了一个代码来只提取单词或句子,但是代码给出了错误,请纠正我在代码中的错误。
// error in regular expression
Regex _regex = new Regex(@"\"\w.+\"");
Match _match = _regex.Match(temp);
if (_match.Success)
{
resourceAnalyticsModel.ResourceFieldName = _match.Value;
}
【问题讨论】:
-
抛出了哪个错误?
-
我将其命名为 "\"type3 type3\"" 但我想要 "type3 type3"
-
现在呢?它会引发错误还是得到错误的结果?准确!
标签: c# regex asp.net-mvc