private static bool GetNegated(string value)
{
switch (GetShorthand(value))
{
case Shorthand.Digit:
case Shorthand.WordCharacter:
case Shorthand.Whitespace:
return false;
case Shorthand.NonDigit:
case Shorthand.NonWordCharacter:
case Shorthand.NonWhitespace:
return true;
default:
throw new InvalidOperationException("Invalid shorthand value.");
}
}