$command =~ m/(!\w+\s?.+?)(?=!\w)/simg; #### my @commands = $command =~ m/(!\w+\s?.+?)(?=!\w)/simg; #### my @commands = $command =~ m/(!\w+\s?.+?)(?=!\w|\z)/simg; #### foreach my $command (@commands) { ... }
## my @commands = $command =~ m/(!\w+\s?.+?)(?=!\w)/simg; ##
## my @commands = $command =~ m/(!\w+\s?.+?)(?=!\w|\z)/simg; ##
## foreach my $command (@commands) { ... }