在VB.net中正则表达特定单词

时间:2014-08-13 06:58:36

标签: vb.net

我想比较字符串

  • "XYZ"
  • " XYZ"
  • "XYZ "
  • ",XYZ"
  • ", XYZ"
  • "XYZ,"
  • " XYZ ,"
  • ",XYZ,"
  • ", XYZ ,"

是否有人建议如何正常表达此特定字符串项?

1 个答案:

答案 0 :(得分:1)

试试这个正则表达式:

[,\s]*?XYZ[,\s]*