^start of line
\s*?any whitespace character, repeated any number of times
Group 1((?:virtual\s*|const\s*|friend\s*){0,3}) Non-Capturing Group(?:virtual\s*|const\s*|friend\s*){0,3} {0,3}repeats the group contents below between 0 and 3 times:
1st Alternativevirtual\s* virtualthe literal text virtual (case sensitive) \s*any whitespace character, repeated any number of times
constthe literal text const (case sensitive) \s*any whitespace character, repeated any number of times
friendthe literal text friend (case sensitive) \s*any whitespace character, repeated any number of times
\s*any whitespace character, repeated any number of times
*?matches any number of characters from the set below:
\wany word character
\s*any whitespace character, repeated any number of times
\w+any word character, repeated at least once
\s*any whitespace character, repeated any number of times
\s*any whitespace character, repeated any number of times
+matches at least one character from the set below:
\wany word character
\s*any whitespace character, repeated any number of times
\(the literal ( (4010 / 508 / 2816)
.*any character (except for line terminators), repeated any number of times
\)the literal ) (4110 / 518 / 2916)
\s*any whitespace character, repeated any number of times
?repeats the group contents below at most once:
constthe literal text const (case sensitive) \s*any whitespace character, repeated any number of times
{the literal { (12310 / 1738 / 7B16)
|the literal | (12410 / 1748 / 7C16)
:the literal : (5810 / 728 / 3A16)
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