Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(?<=\d{2})(\d+)(?=\d{4})
/
gm

Description

MASK TO VALIDATION, WHEN YOU NEED THE AREA CODE OPEN.

TO A CELLPHONE WITH 9 OR 8 DIGITS + AREA CODE OF 2 DIGITS

11 987654321 -> IT WILL GET 98765

Submitted by anonymous - 6 years ago