Monday, September 19, 2011

IntegerNumbersVerifiedWithRegex

Need a way to verify (positive)integer numbers within the range 0-999.999.999 containing dots? Use the following regex ^[1-9]\d{0,2}$|^[1-9]\d{0,2}\.\d{3}$|^[1-9]\d{0,2}\.\d{3}\.\d{3}$ Any optimization comments or better approaches are welcome.

No comments: