0

Hi I have been trying to search a string pattern in Visual Studio 2010 using regex. The string pattern is something like "abc[somevar].ppfunc"

Now "abc" and "ppfunc" are fixed terms but "somevar" could be any string of any length. For example: it could be abc[xyz].ppfunc or abc[ghid].ppfunc or abc[blah].ppfunc

What wild card should I use in place of "somevar" so that search results should contain all possible words present in the code.

I tried abc[].ppfunc and abc[.].ppfunc (in Find and replace box of VS) but it didn't work.

any quick suggestions ?

4

1 回答 1

0

您需要使用 VS2010 的基于正则表达式的查找和替换功能,如此所述。为此,请确保启用正则表达式:

要启用正则表达式,请在查找和替换窗口中展开查找选项,选择使用,然后选择正则表达式。查找内容和替换为字段旁边的三角形表达式生成器按钮变为可用。

然后构造一个匹配你想要替换的正则表达式。

于 2013-03-25T19:37:25.620 回答