Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^ *#define +([a-zA-Z][\w]*)\( *([a-zA-Z_]\w*)(?: *, *([a-zA-Z_]\w*) *) *\) *(.+) *$
/
gm

Description

Regular expression to match C macros specified with the #define directive.

Submitted by Alejandro - 2 years ago (Last modified 2 years ago)