Regular Expressions 101

Community Patterns

C++ parcer for __PRETTY_FUNCTION__

1

Regular Expression
PCRE (PHP <7.3)

/
\s(?:(?:\w+::)*(\w+)(?:<[\w, ]+>){0,1}::){0,1}(\w+)[(]
/
gm

Description

it filters out most of the information and leaves the class name and the function name.

in case of function without class, it will capture namespace and function name.

Submitted by anonymous - 4 years ago