Regular Expressions 101

Community Patterns

One occurrence from 0 to 10 with one decimal.

0

Regular Expression
PCRE (PHP <7.3)

/
^(\d|(\d\,\d)|10){1}$
/
g

Description

Only one occurrence of a value between 0 to 10 with only one decimal using ',' like point. For example: Good: 0,3 0,5 4,2 10 Fail: 92 0,31 3,45

Submitted by anonymous - 7 years ago