This blog is about software development; patterns; best practices. Technologies I prefer: C#, C, .NET web stack, XML, XSLT, Razor, API's, Sitecore, CMS, and and more.
This blog will primarily be about issues I encounter on the way, in order to remember it better myself.
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:
Post a Comment