I am trying to get the Number for an Integer number (No Decimal exist), or the number part before the Decimal Point for a Decimal Number.
The example below should give 12345 as the answer. But it is giving it as 1234 (eating the 5 out)
string isDecimalTypeNumbers = @"^(?<wholeNumberPart>[0-9]*)\.?[0-9]+?$";
Regex pattern = new Regex(isDecimalTypeNumbers);
Match match = pattern.Match("12345");
if (match.Success)
{
string wholeNumberPartWithoutPlusMinusSign = match.Groups["wholeNumberPart"].Value;
MessageBox.Show(wholeNumberPartWithoutPlusMinusSign);
}