בהחלפה תוכל להשתמש בזה:
HTML קוד:
var str="this is |bold| strong word |/bold|"
str = str.replace(/\|bold\|([\s\S]+)\|\/bold\|/gi,"<strong> $1 </strong>")
/* In our word:
replace "|bold|(a String)|/bold|"
with "<strong> (a String) </strong>"
*/
מתוך
www.webmaster.org.il