*/
class BBcode
{
/**
* Holds the bbcode parsers
*
* @var array
*/
public static $parsers = [
'bold' => [
'pattern' => '/\[b\](.*?)\[\/b\]/s',
'replace' => '$1',
'content' => '$1',
],
'italic' => [
'pattern' => '/\[i\](.*?)\[\/i\]/s',
'replace' => '$1',
'content' => '$1',
],
'underline' => [
'pattern' => '/\[u\](.*?)\[\/u\]/s',
'replace' => '$1',
'content' => '$1',
],
'linethrough' => [
'pattern' => '/\[s\](.*?)\[\/s\]/s',
'replace' => '$1',
'content' => '$1',
],
'header' => [
'pattern' => '/\[header\](.*?)\[\/header\]/s',
'replace' => '
$1', 'content' => '$1', ], 'namedquote' => [ 'pattern' => '/\[quote\=(.*?)\](.*)\[\/quote\]/s', 'replace' => '
$1$2', 'content' => '$2', ], 'link' => [ 'pattern' => '/\[url\](.*?)\[\/url\]/s', 'replace' => '$1', 'content' => '$1', ], 'namedlink' => [ 'pattern' => '/\[url\=(.*?)\](.*?)\[\/url\]/s', 'replace' => '$2', 'content' => '$2', ], 'image' => [ 'pattern' => '/\[img\](.*?)\[\/img\]/s', 'replace' => '', 'content' => '$1', ], 'orderedlistnumerical' => [ 'pattern' => '/\[list=1\](.*?)\[\/list\]/s', 'replace' => '
$1
',
'content' => '$1',
],
'youtube' => [
'pattern' => '/\[youtube\](.*?)\[\/youtube\]/s',
'replace' => '',
'content' => '$1',
],
'linebreak' => [
'pattern' => '/\r\n|\r|\n/',
'replace' => '