I am trying enhance the given answer on another post:
^[1-9]\d*(?:\.[05])?$
Breakup:
^ # Start of input
[1-9] # match digit 1 to 9
\d* # match 0 or more of any digits
(?: # start of non-capturing group
\. # match a decimal
[05] # followed by digit 0 or 5
)? # end non-capturing group. (? makes this group optional)
$ # End of input
Only this time the regex needs to accept 0,5 or 0.5 and increments of 0,5 or 0.5
The number zero is the only one that can't be matched.
Already tried:
(?!0).{1}|^[1-9]\d*(?:(,|\.)[05])?$
and
[^0]|^[1-9]\d*(?:(,|\.)[05])?$
Can you help please?