my @parts = $equation =~ /(.*?)([xyz])\s*/gi; say for @parts;