Simple recognition of single + multi-line formulas