Visual Studio 2013需要从属性中删除文本

时间:2014-10-01 15:03:05

标签: regex visual-studio visual-studio-2013

尝试从属性中删除WIF1.2.10

EDITED

自:

QuestionText = "WIF1.1 First Name",
QuestionText = "WIF1.2.10 Middle Name",
QuestionText = "WIF15 Notes to solicitor",

要:

QuestionText = "First Name",
QuestionText = "Middle Name",
QuestionText = "Notes to solicitor",

到目前为止尝试了

自:

QuestionText = "(WIF{\d{1,2}.\d{1,2}.\d{1,2}}) (.*)",

替换为

QuestionText = "$2",

1 个答案:

答案 0 :(得分:1)

只需删除正则表达式中的花括号,并将小数部分设为可选。

QuestionText = "(WIF\d{1,2}(?:(?:\.\d{1,2})?\.\d{1,2})?) ([^"]*)",

替换字符串:

QuestionText = "$2",

DEMO