Instead of adding `random` to the regex, why not just strip it from the query?

```perl
$_ =~ s/\s*random\s*//;
```

You could also just `s/random//` and then use `String::Trim` on `$_`