Reputation: 1
I have a situation where i need to search for couple of objects in my code files. currently i m doing it by seaching using visual studio search option for every text i want to search. I want to use regular expression ( search -> use -> regular expression ) to search all my text at once using OR operator. Please suggest me for that, as i am not much familiar with regular expression syntax.
Sry for editing in question itself.. I got the answer. Like if I want to search for objects 'abc','xyz' I would put abc|xyz in visual studio seach box. But i don't know how to make this search case insensitive. I got a hint of using /i or -i or ?i , but where and how - i don't know .
Upvotes: 0
Views: 2263
Reputation: 1
I've found that the search in file using regular expression is buggy in regard to case sensitivity in Visual Studio 2015. Even with the "Match case" option turned on, it will match text ignoring case by default.
The one trick that somehow fixed this is by using capture, surrounding the literal text you want with parenthesis in addition to the "Match case" option!
So instead of: abc.def Use: (abc).(def)
Upvotes: 0
Reputation: 9729
As far as I know, Visual Studio should search case insensitive, unless you check the box that says "Match case" (see screenshot).
Upvotes: 2
Reputation: 169008
You can use the alternation operator | to effectively OR part of the regex. So (foo)|(bar)
will find either the text "foo" or the text "bar". Either side, can of course, be a regular expression on its own, so you can come up with some pretty complicated stuff.
But as zzzzBov said, if you want any more help you're going to have to supply more information. Or you could actually, you know, read the documentation.
Upvotes: 0