datagrid icon indicating copy to clipboard operation
datagrid copied to clipboard

FilterText filtering with quotation marks

Open czita opened this issue 6 years ago • 0 comments

Hi, could be changed behavior in filterText to filtering with quotation marks? Google like, for example: "not splitted search" and next splitted words

Because simple split by spacing is not enought.

Better could be something like this:

    public function getSplittedWords($value)
    {
        if ($this->hasSplitWordsSearch() === false) {
            return [$value];
        } else {
            preg_match_all('/([^\s"\']+)|"([^"]*)"|\'([^\']*)\'/', $value, $m);
            return array_filter(array_merge($m[1], $m[2], $m[3]));
        }
    }

Regular expression from https://stackoverflow.com/a/366532

czita avatar Mar 27 '19 10:03 czita