El codigo PHP del parser es:
Código PHP:
function limpiar( $source )
{
return preg_replace_callback(
"/\[([^\]=:]*) ([=:])?([^\]]*)?\] (.*) \[\/\\1[^\]]*\]/",
function($match) {
$noBorrar = array("center","b");
return (array_search($match[1], $noBorrar ) !== FALSE) ? $match[4] : "";},
$source);
}
los bbcode como me figuran son:
Código PHP:
[img:1po49hhv]http://www.dogster.com/files/after%20administration%20crop.jpg[/img:1po49hhv]
[video:3tnj7i7d]http://www.youtube.com/watch?v=XAOUlsrmzYM[/video:3tnj7i7d]
[b:s85gxxhg]HTC First, el smartphone de y con Facebook[/b:s85gxxhg]
[list:s85gxxhg] [*:s85gxxhg]Sistema operativo [b:s85gxxhg]Android 4.1 Jelly Bean[/b:s85gxxhg][/*:m:s85gxxhg] [*:s85gxxhg]Pantalla 4.3 pulgadas con resolución 1280x720 píxeles. Densidad 342 ppi.[/*:m:s85gxxhg] [*:s85gxxhg]Procesador Snapdragon 400 de doble núcleo.[/*:m:s85gxxhg] [*:s85gxxhg]GPU Adreno 305.[/*:m:s85gxxhg] [*:s85gxxhg]1 GB de memoria RAM.[/*:m:s85gxxhg] [*:s85gxxhg]16 GB de memoria de almacenamiento. No expansibles. [/*:m:s85gxxhg] [*:s85gxxhg]Camara principal de 5 megapíxeles con auto-focus y FlashLED. Camara frontal de 1.6 megapíxeles.[/*:m:s85gxxhg] [*:s85gxxhg]HTC Sense 4.1, Instagram y Facebook Home de serie.[/*:m:s85gxxhg] [*:s85gxxhg]Batería 2000 mAh [/*:m:s85gxxhg][/list:u:s85gxxhg] [center:s85gxxhg][img:s85gxxhg]http://imageshack.us/a/img829/6071/htcfirstcolors.jpg[/img:s85gxxhg][/center:s85gxxhg]