protected function tag(&$tag, $simple = false)
    {
        if ($simple) {
            $chars = '^,:;{}\][>\(\) "\'';
        } else {
            $chars = '^,;{}["\'';
        }

        if (!$simple && $this->tagExpression($tag)) {
            return true;
        }

        $tag = '';
        while ($this->tagBracket($first)) {
            $tag .= $first;
        }

        while (true) {
            if ($this->match('(['.$chars.'0-9]['.$chars.']*)', $m)) {
                $tag .= $m[1];
                if ($simple) {
                    break;
                }

                while ($this->tagBracket($brack)) {
                    $tag .= $brack;
                }
                continue;
            } elseif ($this->unit($unit)) { // for keyframes
                $tag .= $unit[1].$unit[2];
                continue;
            }
            break;
        }

        $tag = trim($tag);
        if ($tag == '') {
            return false;
        }

        return true;
    }
protected function tag(&$tag, $simple = false)
    {
        if ($simple) {
            $chars = '^,:;{}\][>\(\) "\'';
        } else {
            $chars = '^,;{}["\'';
        }

        if (!$simple && $this->tagExpression($tag)) {
            return true;
        }

        $tag = '';
        while ($this->tagBracket($first)) {
            $tag .= $first;
        }

        while (true) {
            if ($this->match('(['.$chars.'0-9]['.$chars.']*)', $m)) {
                $tag .= $m[1];
                if ($simple) {
                    break;
                }

                while ($this->tagBracket($brack)) {
                    $tag .= $brack;
                }
                continue;
            } elseif ($this->unit($unit)) { // for keyframes
                $tag .= $unit[1].$unit[2];
                continue;
            }
            break;
        }

        $tag = trim($tag);
        if ($tag == '') {
            return false;
        }

        return true;
    }
protected function tag ( & $ tag , $ simple = false ) { if ( $ simple ) { $ chars = '^,:;{}\][>\(\) "\'' ; } else { $ chars = '^,;{}["\'' ; } if ( ! $ simple && $ this -> tagExpression ( $ tag ) ) { return true ; } $ tag = '' ; while ( $ this -> tagBracket ( $ first ) ) { $ tag .= $ first ; } while ( true ) { if ( $ this -> match ( '([' . $ chars . '0-9][' . $ chars . ']*)' , $ m ) ) { $ tag .= $ m [ 1 ] ; if ( $ simple ) { break ; } while ( $ this -> tagBracket ( $ brack ) ) { $ tag .= $ brack ; } continue ; } elseif ( $ this -> unit ( $ unit ) ) { // for keyframes $ tag .= $ unit [ 1 ] . $ unit [ 2 ] ; continue ; } break ; } $ tag = trim ( $ tag ) ; if ( $ tag == '' ) { return false ; } return true ; }
a single tag
a single tag