Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
([a-zA-Z_]\w+|[a-zA-Z]\w*|\[\s*[a-zA-Z_]\w+\s*\]|\[\s*[a-zA-Z]\w*\s*\])\s*\[\s*['"]([a-zA-Z_]\w+|[a-zA-Z]\w*)['"]\s*\]
/
gm

Description

finds and replaces square bracketed string literals with period and the field name

Submitted by Andrew Stevens - a year ago (Last modified a year ago)