This is caused by the 'end' environment being keyed on the end of line character rather than the semicolon. The problem then becomes dealing with strings that are also able to wrap lines, but currently would have to be covered under the '(.*)' pattern which only matches a single line.