^start of line
\s*any whitespace character, repeated any number of times
?repeats the group contents below at most once:
Publicthe literal text Public (case sensitive) Privatethe literal text Private (case sensitive) Non-Capturing Group(?:\s*) \s*any whitespace character, repeated any number of times
Functionthe literal text Function (case sensitive) Subthe literal text Sub (case sensitive) Non-Capturing Group(?:\s*) \s*any whitespace character, repeated any number of times
a-zone character from a (9710) to z (12210) (case sensitive)
A-Zone character from A (6510) to Z (9010) (case sensitive)
_the literal _ (9510 / 1378 / 5F16)
\w*any word character, repeated any number of times
\s*any whitespace character, repeated any number of times
Non-Capturing Group(?:\() \(the literal ( (4010 / 508 / 2816)
Negated Character Class[^)]* *matches any number of characters outside the set below:
)the literal ) (4110 / 518 / 2916)
Non-Capturing Group(?:\)) \)the literal ) (4110 / 518 / 2916)
Non-Capturing Group(?:\sAs\s)? ?repeats the group contents below at most once:
\sany whitespace character
Asthe literal text As (case sensitive) \sany whitespace character
?repeats the group contents below at most once:
\w*any word character, repeated any number of times
*?matches any number of characters from the set below:
\sany whitespace character
\Sany non-whitespace character
^start of line
\s*any whitespace character, repeated any number of times
Non-Capturing Group(?:End Function|End Sub) 1st AlternativeEnd Function End Functionthe literal text End Function (case sensitive) End Subthe literal text End Sub (case sensitive) 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