Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
(^[1-4]{1}(\.\d{0,1})?$)|(^5{1}$)
/

Description

this regular expression allow numbers with one number from 1 to 5 and only one decimal value Onlys accept numeric values from 1.0 to 5

Submitted by anonymous - 9 years ago