SQL Server, Analytics, .Net, Machine Learning, R, Python
Wednesday, March 06, 2013
.NET Regex: Character Class Subtraction
You’ve heard of a positive match character group  and a negative match character group [^]. But did you know there is also a Character Class Subtraction? I didn’t. It’s supported in .NET but not in the majority of RegEx flavours.
Using this format, the pattern
can be used in .NET to match all alphanumeric characters (any word character) excluding the letter v and numbers 123.
The MSDN page for the .NET Regex definitions doesn’t seem to appear high in the search indexes, so bookmarking here for my future reference: Character Classes in Regular Expressions
This is useful for comparing Regex capabilities in different languages: regex flavor comparison chart
MSN, Email: mitch døt wheat at gmail.com