/
if\s*\((?P<conditional>(?:(?:(?:"(?:(?:\\")|[^"])*")|(?:'(?:(?:\\')|[^'])*'))|[^\(\)]|\((?1)\))*+)\)\s*(?P<true_body>(?:{(?:(?:(?:"(?:(?:\\")|[^"])*")|(?:'(?:(?:\\')|[^'])*'))|[^{}]|{(?2)})*+})|(?:[^{}\n]*))\s*(?:(?:else\s+?(?!if)(?P<else_body>(?:{(?:(?:(?:(?:"(?:(?:\\")|[^"])*")|(?:'(?:(?:\\')|[^'])*'))|[^{}]|{(?3)})+)})|(?:[^{}\n])*)\s*)|(?:else\s*if\s*\((?P<else_if_condition>(?:(?:(?:"(?:(?:\\")|[^"])*")|(?:'(?:(?:\\')|[^'])*'))|[^\(\)]|\((?4)\))+)\)\s*(?P<else_if_body>(?:(?:{(?:(?:(?:"(?:(?:\\")|[^"])*")|(?:'(?:(?:\\')|[^'])*'))|[^{}]|{(?5)})+})|(?:[^{}\n]*)))\s*))*
/
gmi