/** * Returns a value indicating if a token of this type can be matched at * the start of the subject string. * @param string the subject string * @return mixed match at the start of the string or false if no match */ public static function isa($subject) { if (empty(self::$regex)) { self::$regex = str_replace('{CSS_COLOURS}', join('|', array_reverse(array_keys(self::$svgColours))), self::MATCH); } return preg_match(self::$regex, strtolower($subject), $matches) ? $matches[0] : false; }