Regular Expressions 101

Community Patterns

Euro prices with steps of 5000 (e.g 5.000, 10.000 - 255.000)

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