roundcubemail/program/lib/Roundcube/rcube_utils.php
public static function tokenize_string($str, $minlen = 2)
    {
        $expr = array('/[\s;,"\'\/+-]+/ui', '/(\d)[-.\s]+(\d)/u');
        $repl = array(' ', '\\1\\2');

        if ($minlen > 1) {
            $minlen--;
            $expr[] = "/(^|\s+)\w{1,$minlen}(\s+|$)/u";
            $repl[] = ' ';
        }

        return array_filter(explode(" ", preg_replace($expr, $repl, $str)));
    }
public static function tokenize_string($str, $minlen = 2)
    {
        $expr = array('/[\s;,"\'\/+-]+/ui', '/(\d)[-.\s]+(\d)/u');
        $repl = array(' ', '\\1\\2');

        if ($minlen > 1) {
            $minlen--;
            $expr[] = "/(^|\s+)\w{1,$minlen}(\s+|$)/u";
            $repl[] = ' ';
        }

        return array_filter(explode(" ", preg_replace($expr, $repl, $str)));
    }
public static function tokenize_string ( $ str , $ minlen = 2 ) { $ expr = array ( '/[\s;,"\'\/+-]+/ui' , '/(\d)[-.\s]+(\d)/u' ) ; $ repl = array ( ' ' , '\\1\\2' ) ; if ( $ minlen > 1 ) { $ minlen -- ; $ expr [ ] = "/(^|\s+)\w{1,$minlen}(\s+|$)/u" ; $ repl [ ] = ' ' ; } return array_filter ( explode ( " " , preg_replace ( $ expr , $ repl , $ str ) ) ) ; }
Split the given string into word tokens

@param string Input to tokenize
@param integer Minimum length of a single token
@return array List of tokens
Split the given string into word tokens