Community Patterns

Community Library Entry

0

Regular Expression
Created·2019-12-20 16:39
Flavor·PCRE (Legacy)

/
(?P<nested> \b if \b (?P<if>(?>.?(?>(?P>nested))?)*?) (?: \b elsif \b (?P<elsif>(?>.?(?>(?P>nested))?)*?) )? (?: \b else \b (?P<else>(?>.?(?>(?P>nested))?)*?) )? \b endif \b )?
/
ixs
Open regex in editor

Description

catchs multiple elsifs in the only elsif group take care of keywords in comments, mask out them first

Submitted by anonymous