I was trying to find all occurences of my c# copy constructor-like constructors with the search window in visual studio using regex.
For example, I would like to find the following:
MyClass(MyClass other)
I used the following regex, but it did not give any results (it should):
(?<cn>\w)\(?<cn> \w\)
What do I do wrong please?
Many thanks.
Based on your answers, I could successfully build the right RegEx for Visual Studio:
(?<cpy>\b\w+\b)\s*\(\s*\k<cpy>\s+\w+\s*\)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With