Regular Expressions 101

Community Patterns

PHP variable name

13

Regular Expression
PCRE (PHP <7.3)

/
[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*
/

Description

Valid PHP variable name as defined in the manual at http://php.net/manual/en/language.variables.basics.php

Submitted by Erin Millard - 11 years ago