Regular Expressions 101

Community Patterns

Community Library Entry

-1

Regular Expression
PCRE (PHP <7.3)

/
\b\d{2}([8-9]\d{8}|[1-7]\d{7})\b
/
g

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 - 4 years ago