protected function _prepareRegex($word) {
        $letters = str_split($word);
        $regex = '';

        foreach ($letters as $letter) {
            $regex .= preg_quote($letter, '/') . '+';
        }

        $suffix = $this->getConfig('suffix');

        if (is_array($suffix)) {
            $suffix = implode('|', $suffix);
        }

        $regex .= '(?:' . $suffix . ')?';

        return $regex;
    }
protected function _prepareRegex($word) {
        $letters = str_split($word);
        $regex = '';

        foreach ($letters as $letter) {
            $regex .= preg_quote($letter, '/') . '+';
        }

        $suffix = $this->getConfig('suffix');

        if (is_array($suffix)) {
            $suffix = implode('|', $suffix);
        }

        $regex .= '(?:' . $suffix . ')?';

        return $regex;
    }
protected function _prepareRegex ( $ word ) { $ letters = str_split ( $ word ) ; $ regex = '' ; foreach ( $ letters as $ letter ) { $ regex .= preg_quote ( $ letter , '/' ) . '+' ; } $ suffix = $ this -> getConfig ( 'suffix' ) ; if ( is_array ( $ suffix ) ) { $ suffix = implode ( '|' , $ suffix ) ; } $ regex .= '(?:' . $ suffix . ')?' ; return $ regex ; }
Prepare the regex pattern for each word.

@param string $word
@return string
Prepare the regex pattern for each word .