public function getPreMatch()
    {
        if ($this->match) {
            return mb_substr($this->source, 0,
                ($this->head - mb_strlen($this->match)));
        } else {
            return null;
        }
    }
public function getPreMatch()
    {
        if ($this->match) {
            return mb_substr($this->source, 0,
                ($this->head - mb_strlen($this->match)));
        } else {
            return null;
        }
    }
public function getPreMatch ( ) { if ( $ this -> match ) { return mb_substr ( $ this -> source , 0 , ( $ this -> head - mb_strlen ( $ this -> match ) ) ) ; } else { return null ; } }
Returns the portion of the source string leading up to, but not
including, the most recent match. Returns null if there is no recent
match.

@return string|null
Returns the portion of the source string leading up to but not including the most recent match . Returns null if there is no recent match .