Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^(\+)?(0|27)([5-9])([0-9])( )?([0-9]{3})( )?([0-9]{4})$
/
gm

Description

Will match on South African Cell numbers includes optional country code. --doesn't support "00<C_code>" coding. Only supports "+<C_code>" allows for splitting the number with spaces eg.+2786 123 4567

Submitted by Zalatos - 9 years ago