JSFiddle - React, Tailwind, and code Playground
by tuga
JavaScript
var myCode = "[i]test[/i] something more and [b]test[/b]";
myCode = myCode.replace(/\[(b|i|p)\](.*?)\[\/(b|i|p)\]/g, "<$1>$2</$3>");
alert (myCode);
by tuga
var myCode = "[i]test[/i] something more and [b]test[/b]";
myCode = myCode.replace(/\[(b|i|p)\](.*?)\[\/(b|i|p)\]/g, "<$1>$2</$3>");
alert (myCode);