in reply to search string regex

I think you can use your original design. Please do not match quotes in quotes.
my @quotes = $keyword =~ s/"([^"]*)?"//; my @keys = split(/ /, $keyword);
If you think about spaces at the end or two spaces in the middle modify your code like
my @keys =grep length, split(/ /, $keyword);
or
my @keys = split(" ", $keyword);