Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^-?\d{0,}(\,\d{1,})?$
/
gm

Description

This was, I think built to detect a comma separated decimal. But ended up with a capture group on the decimal part. Don't ask me why.

Submitted by Russ Ferriday - after DS - 3 years ago