function tagPattern($tag_names, $close, $self_close)
    {
        if (is_array($tag_names)) {
            $tag_names = '(?:'.implode('|',$tag_names).')';
        }
        if ($close) {
            $close = '\/' . (($close == 1)? '' : '?');
        } else {
            $close = '';
        }
        if ($self_close) {
            $self_close = '(?:\/\s*)' . (($self_close == 1)? '' : '?');
        } else {
            $self_close = '';
        }
        $expr = sprintf($this->_tag_expr, $close, $tag_names, $self_close);

        return sprintf("/%s/%s", $expr, $this->_re_flags);
    }
function tagPattern($tag_names, $close, $self_close)
    {
        if (is_array($tag_names)) {
            $tag_names = '(?:'.implode('|',$tag_names).')';
        }
        if ($close) {
            $close = '\/' . (($close == 1)? '' : '?');
        } else {
            $close = '';
        }
        if ($self_close) {
            $self_close = '(?:\/\s*)' . (($self_close == 1)? '' : '?');
        } else {
            $self_close = '';
        }
        $expr = sprintf($this->_tag_expr, $close, $tag_names, $self_close);

        return sprintf("/%s/%s", $expr, $this->_re_flags);
    }
function tagPattern ( $ tag_names , $ close , $ self_close ) { if ( is_array ( $ tag_names ) ) { $ tag_names = '(?:' . implode ( '|' , $ tag_names ) . ')' ; } if ( $ close ) { $ close = '\/' . ( ( $ close == 1 ) ? '' : '?' ) ; } else { $ close = '' ; } if ( $ self_close ) { $ self_close = '(?:\/\s*)' . ( ( $ self_close == 1 ) ? '' : '?' ) ; } else { $ self_close = '' ; } $ expr = sprintf ( $ this -> _tag_expr , $ close , $ tag_names , $ self_close ) ; return sprintf ( "/%s/%s" , $ expr , $ this -> _re_flags ) ; }
Create a regular expression that will match an opening
or closing tag from a set of names.

@access private
@param mixed $tag_names Tag names to match
@param mixed $close false/0 = no, true/1 = yes, other = maybe
@param mixed $self_close false/0 = no, true/1 = yes, other = maybe
@return string $regex A regular expression string to be used
in, say, preg_match.
Create a regular expression that will match an opening or closing tag from a set of names .