Regular Expressions 101

Community Patterns

1...45678...902

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^[]\s(1?[5]000|[1-9]{1}[5,0]{1,3}([0]{3,10}))$
/
mg

Description

To validate a price of 5.000 and steps of 5.000 thereafter. (e.g 5.000, 10.000, 15.000 etc) including a euro sign.

If anyone has any improvements let me know, this is what i just came up with to solve a problem i have on WordPress Contact Form 7.

Submitted by anonymous - 7 years ago