How do I modify this regex so that 0 isn’t matched, but the number like 15.0 is? See: http://rubular.com/r/8OMVYh0SBw. I can’t quite figure it out. Regex is my Achilles heel.
^[+-]?(?:(?!0)\d{1,2}|0)(?:\.5)?$
FYI – everything above the dashed line is supposed to be matched, and anything below shouldn’t be matched.
This works perfectly for me.
rubular
For the future, the following two are equivalent, but the latter is more efficient.