(?x)applies the following effective flags to the remainder of the pattern: gmx x modifier: extended. Ignores unescaped whitespace and comments outside character classes
\s*any whitespace character, repeated any number of times
Group with flags gmx(?-i:\bfunction\b)? ?repeats the group contents below at most once:
i modifier: -insensitive. Case-sensitive match
\ban ASCII word boundary
functionthe literal text function (case sensitive) \ban ASCII word boundary
\s*any whitespace character, repeated any number of times
Character Class[A-Za-z_$] A-Zone character from A (6510) to Z (9010) (case sensitive)
a-zone character from a (9710) to z (12210) (case sensitive)
_the literal _ (9510 / 1378 / 5F16)
$the literal $ (3610 / 448 / 2416)
*matches any number of characters from the set below:
\wany word character
$the literal $ (3610 / 448 / 2416)
\s*any whitespace character, repeated any number of times
Group with flags gmx(?-i:\bfunction\b)? ?repeats the group contents below at most once:
i modifier: -insensitive. Case-sensitive match
\ban ASCII word boundary
functionthe literal text function (case sensitive) \ban ASCII word boundary
\s*any whitespace character, repeated any number of times
\s*any whitespace character, repeated any number of times
\(the literal ( (4010 / 508 / 2816)
Negated Character Class[^()]* *matches any number of characters outside the set below:
(the literal ( (4010 / 508 / 2816)
)the literal ) (4110 / 518 / 2916)
\)the literal ) (4110 / 518 / 2916)
\s*any whitespace character, repeated any number of times
\{the literal { (12310 / 1738 / 7B16)
g modifier: global. Finds all matches instead of stopping after the first
m modifier: multiline. Causes ^ and $ to match the start and end of each line, not only the start and end of the string