在vb.net中使用Regex在字符串中查找字符串

时间:2015-03-13 10:30:02

标签: regex vb.net string find

我有以下字符串。

dim str=
 "tblIDs = ExecuteSPReader("USP_testSP", GENRL.MakeArrayList("ID", "2", "TypeID", 30))"

现在我想使用正则表达式找到类似"USP"的字符串。谁能告诉我正则表达式找出这个字符串。

提前致谢。

1 个答案:

答案 0 :(得分:0)

这应该这样做:

Dim result As String = Regex.Match(str,"(?<=ExecuteSPReader\("")[^_]+").Value

有效意味着:查看ExecuteSPReader("后面,找到不是_的连续字符