Regular Expressions 101

Community Patterns

Suriname phone number

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^\+597[78]\d{6}$
/
gm

Description

So the regular expression ensures that the phone number starts with "+597", followed by either a 7 or 8, and then six more digits. This will match all three phone numbers you provided as examples.

Submitted by Kenny - a year ago