Small optimization in syntax regular expressions