Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^(10)$|^[0-9](\.[0-9])?$
/

Description

Validate grades between 0 to 10. With one decimal at max (1.1)

Submitted by bascoder - 9 years ago