Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(?!000)(?!900)(?!976)(?!800)(?!855)(?!866)(?!877)(?!888)^([0-9]( |-)?)?(\(?[0-9]{3}\)?|[0-9]{3})( |-)?([0-9]{3}( |-)?[0-9]{4}|[a-zA-Z0-9]{7})$
/
m

Description

Block 800, 855, 866, 877, 888 as well as 900 numbers.

Submitted by hammraido - 8 years ago