Regular Expressions 101

Community Patterns

Matches invalid Excel table names

0

Regular Expression
PCRE (PHP <7.3)

/
(^[^a-z\._\\])|(\s)|.{256,}|[^a-z0-9_\.\\]|(\w{1,2})[0-9]+|^[rc]$
/
gmi

Description

This regex is designed to match invalid regex names. The known false positive is when the \w{1,2}+[0-9]+ pattern matches things which fall outside the scope of an Excel documents range, and therefore become valid table references.

Submitted by anonymous - 5 years ago