Since VS2013, VS uses then .NET regex syntax, which is more standard and that is a good thing.
However, I haven't been able to find a shorthand for matching identifiers, which previously was :i
!
MSDN says that :i
was replaced by \b(_\w+|[\w-[0-9_]]\w*)\b
... so does this short reference.
Is there really no shorter version?
Let's check:
VS2005-2010:
VS2012-2015:
Now, test the new regex and old regex. The results are the same and both match
&type1
and#define
. No idea if it is intended.However, when it comes for shortening,
[\w-[0-9_]]
is almost equal to\p{L}
in .NET (\w
without 0-9 and an underscore, but still matching some Hindi and some other digits). I guess\p{L}
was actually meant, and you can use\b(_\w+|\p{L}\w*)\b
.If you do not want to match
&type
or#define
, you need a look-behind version:Or - perhaps - with a whitespace check before the word: