Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Java 8

"
(?<elIf>#elif\((?<elIfContents>[^\)]+)\)(?<elIfResult>[\s\S]+?(?=#elif|#end)))
"
gi

Description

This is part 2 of my if else parser. Part 2 is only needed for elif statements.

Note: From the elif result from part 1 add a #end to close the statement. I might change it a bit in the future so this isn't needed.

Part 1 can be found here

Submitted by Rubeste - 3 years ago