Regular Expressions 101

Community Patterns

grades 0 to 10

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 - 8 years ago