Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
\s+([a-z]+): \{\n\s+name: \"([a-zA-Z ]+)\",\n(?:\s+dualwield: (!0),\n)?\s+primary: \"([a-z]+)\",\n\s+imageSuffix: \"([a-z_]+)\",\n\s+imageSuffixAlt: \"([a-z_]+)\",\n\s+resources: ([\[\"a-z\], ]+)\n\s+},\n
/
gm

Description

Uses JS file with all data (class data only) to make a PHP array (to be used in PHP framework).

Submitted by anonymous - 6 years ago