BBCodeLexer::__construct( $string, $tagmarker = '[' )
Description
Source
File: bp-forums/admin/parser.php
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | function __construct( $string , $tagmarker = '[' ) { $regex_beginmarkers = Array( '[' => '\[' , '<' => '<' , '{' => '\{' , '(' => '\(' ); $regex_endmarkers = Array( '[' => '\]' , '<' => '>' , '{' => '\}' , '(' => '\)' ); $endmarkers = Array( '[' => ']' , '<' => '>' , '{' => '}' , '(' => ')' ); if (!isset( $regex_endmarkers [ $tagmarker ])) $tagmarker = '[' ; $e = $regex_endmarkers [ $tagmarker ]; $b = $regex_beginmarkers [ $tagmarker ]; $this ->tagmarker = $tagmarker ; $this ->end_tagmarker = $endmarkers [ $tagmarker ]; $this ->pat_main = "/( " . "{$b}" . "(?! -- | ' | !-- | {$b}{$b} )" . "(?: [^\\n\\r{$b}{$e}] | \\\" [^\\\"\\n\\r]* \\\" | \\' [^\\'\\n\\r]* \\' )*" . "{$e}" . "| {$b}{$b} (?: [^{$e}\\r\\n] | {$e}[^{$e}\\r\\n] )* {$e}{$e}" . "| {$b} (?: -- | ' ) (?: [^{$e}\\n\\r]* ) {$e}" . "| {$b}!-- (?: [^-] | -[^-] | --[^{$e}] )* --{$e}" . "| -----+" . "| \\x0D\\x0A | \\x0A\\x0D | \\x0D | \\x0A" . "| [\\x00-\\x09\\x0B-\\x0C\\x0E-\\x20]+(?=[\\x0D\\x0A{$b}]|-----|$)" . "| (?<=[\\x0D\\x0A{$e}]|-----|^)[\\x00-\\x09\\x0B-\\x0C\\x0E-\\x20]+" . " )/Dx" ; $this ->input = preg_split( $this ->pat_main, $string , -1, PREG_SPLIT_DELIM_CAPTURE); $this ->pat_comment = "/^ {$b} (?: -- | ' ) /Dx" ; $this ->pat_comment2 = "/^ {$b}!-- (?: [^-] | -[^-] | --[^{$e}] )* --{$e} $/Dx" ; $this ->pat_wiki = "/^ {$b}{$b} ([^\\|]*) (?:\\|(.*))? {$e}{$e} $/Dx" ; $this ->ptr = 0; $this ->unget = false; $this ->state = BBCODE_LEXSTATE_TEXT; $this ->verbatim = false; $this ->token = BBCODE_EOI; $this ->tag = false; $this ->text = "" ; } |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.