Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(?=.{8,20}$)(\b\D*(\d)\2{7,}\D*\b)$
/
g

Description

Match 8 or more consecutive digits irrespective of it's position in the string with string length between 8 and 20. ex: 11111111 - match ASD11111111 - match ASD22222222oook - match 777kjoi77777 - no match etc.,

Submitted by Cyanotrix - 8 years ago