Regular Expressions 101

Community Patterns

Match the longest repeating subsequence of a digit

0

Regular Expression
PCRE (PHP <7.3)

/
(\d)(?<!(?=\1)..)(?=(\1*)(?!\1).*(?!\1).\1\2(?!\1))(?!(?:(?=\2((\3?+)(\d)(\5*)))){1,592}?(?=\2\3.*(?!\5).\5\6(?!\5))(?:\1(?=\1*\4\5(\7?+\5)))*+(?!\1))\2
/
mg

Description

Submitted by anonymous - 6 years ago