My code is currently using the following Regex expression which matches on numbers:
Regex numberExpression = new Regex(@"(?<Number>\d+)");
This current works fine for input strings like "1", "100", "1a", "a1", etc....
But I want to change it so it does NOT match when the input string contains a letter, so "1", "100" would match, but "1a", "a1", would not.
Can anyone help, I know this is a simple regular expression question but I can't get my head around the forward and backward looking. I have tried:
Regex numberExpression = new Regex(@"(?<Number>^![a-zA-Z]\d+![a-zA-Z])");
but that didn't work, and fails to match any of the above input.