Regular Expressions 101

Community Patterns

Match numbers with consecutive digits

1

Regular Expression
PCRE (PHP <7.3)

/
((?=\b\d{3}\b)0?1?2?3?4?5?6?7?8?9?(?<=\d{3}))
/
gm

Description

Match numbers with consecutive digits and of length 3.

Submitted by OnlineCop - 9 years ago