Q: Regular expression for restricted signed number formats I want a regex for the following given pattern:
{anynumber} will return true.
+{anynumber} will return true.
-{anynumber} will return false.
{anynumber}.5 OR {anynumber}.50 OR {anynumber}.500 and similar pattern will return true (i.e. any number of zeros after .5).
+{anynumber}.5 / +{anynumber}.50 / +{anynumber}.500 and similar pattern will return true.
-{anynumber}.5 / -{anynumber}.50 / -{anynumber}.500 and similar pattern will return false.
+{anynumber}.6 / +{anynumber}.75 / +{anynumber}.205 and similar pattern will return false (i.e. after decimal point only 5 is allowed at the first place with any or no number of zeros afterwards).
No limitations of length of numbers.

A: Here you are:
^(?:(?: \/ )?[+]?[0-9]+(?:\.50*\b)?)+$
And here is a demo.
