Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(5$|5.0$|5.00$|^(?:4(?:\.[0-9]{0,2})?|[1-4](?:\.[0-9]{0,2})?|1?\.[0-9]{0,2})$)
/
gm

Description

Regular expression to filter decimal from 1.00 to 5.00 ( inclusive) Plus occurrence of 0

Submitted by anonymous - 4 years ago