Merge overlapping patterns

I'm not completely sure about this. Specifically I'm not sure that `.|[` goes fine into a pattern. Also the previous code would match `fclose ( %var% . %varid%"` (no closing brace) and the new one only matches the same when there is a closing brace - I'd guess the previous code was wrong.