[ticket/12781] Template regex for IF catch too many things

https://tracker.phpbb.com/browse/PHPBB3-12781

PHPBB3-12781