(?-xism:(?ig:(?:create table ([a-z]|[_])+(?{$self->{m}=1})|insert \b([a-z]|[_])+\b (?{$self->{m}=3})|lock table(?{$self->{m}=0})|grant(?{$self->{m}=2})))) #### my @parts = split /(?=(?-xism:(?ig:(?:create table ([a-z]|[_])+(?{$self->{m}=1})|insert \b([a-z]|[_])+\b (?{$self->{m}=3})|lock table(?{$self->{m}=0})|grant(?{$self->{m}=2})))))/, $text;