正则表达式(VB.NET)

时间:2014-03-12 17:08:14

标签: regex vb.net

我如何转换它:

, ...Name: John, LastName: Smith, Gender: Male, ...

, ...Name: John, Gender: Male, ...

注意我将“LastName:XXXXX”替换为“”(空链)

我试过

'Remove LastName...
pattern = " LastName.*,"
replacement = ","
msAccessQuery = Regex.Replace(string, pattern, replacement)

提前致谢。

1 个答案:

答案 0 :(得分:1)

模式将是:

 \s*LastName:[^,]*,