Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^\d{8,}|SC\d{6,}|NI\d{6,}|OC\d{6,}|RO\d{6,}|SO\d{6,}$
/
gi

Description

Checks that the number and optional prefix submitted are in a valid UK Companies House format.

Submitted by Steve Haworth - 9 years ago