How to find the whole expression "variable = variable;" in visual studio 2008?

I want to find the whole expression variable = variable;in my source files. I am using Visual Studio 2008.

variable- any variable, for example x, i, k123, incr15.

Examples:

x = x;           // Should find
x = y;           // No match
ss12 = ss12;     // Should find
ss12 = ss12 + 1; // No match
+3
source share
6 answers

Use the Find dialog with regex ...

{:a+} = \1

will do the trick.
: a - any alphanumeric character
\ 1 is a backlink to everything that is included in {}

See here for more details .

EDIT - in response to the comment:

^:b*{:a+}:b*=:b*\1;

^ - beginning of line: b - tab / space

EDIT2: , : : a

+6
+4

.

:\w * =\w *

0

" " " ".

- :

\ W +\s * =\S *\W +;

0

" ".

/ , CTRL + SHIFT + F, " " " ",

0

Have you tried the Find All Links feature in the context menu?

-1
source

Source: https://habr.com/ru/post/1723216/


All Articles