I\'m attempting to build a regular expression (.NET) to match a percentage with 4 decimal places. The 4 decimal places are required. The range looks like:
Just treat the 100.0000 possibility as a separate case. It's easy to match that (100\.0000), and it's easy to match the rest ([1-9]?\d\.\d{4}), so with the two as alternates you get:
^(100\.0000|[1-9]?\d\.\d{4})$
(Assuming you want it to be the whole text, otherwise leave out the ^ and the $.