Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^((?:[0-9]+,{1}?)+[0-9]+)$
/
g

Description

Matches a number sequence separated by a comma: 1234,1234,1234,1234

won't match:

  • Letters
  • If sequence ends with a comma
  • If sequence has double comma's.
Submitted by Jordy van Domselaar <jordy.van.domselaar@outlook.com> - 7 years ago