怎么为正则表达式匹配的字符串加上span包裹起来?

var re=/world|people|Pizar/g
var str = "Disney films are favored by people all around the world, it is known to all that many of the movies are produced by Pizar animation studio";

有一个正则表达式,还有一个字符串,我想为这个字符串中所有匹配正则表达式的单词分别都加上一个< span >包裹起来,例如:< span >world< /span >一样。请问怎么才能办到呢?

 var re=/(world|people|Pizar)/g
var str = "Disney films are favored by people all around the world, it is known to all that many of the movies are produced by Pizar animation studio";
str=str.replace(re,'<span>$1</span>')
alert(str)

/<span>world<\/span>/g;//像这样就可以了。