jjzjj

fffirstword

全部标签

javascript - 将 '#ff00fffirstword#445533secondword#008877thirdword' 转换为 html 标签格式

我可以将字符串#ff00fffirstword#445533secondword#008877thirdword转换为firstwordsecondwordthirdword在javascript或actionscript3程序中使用正则表达式?我尝试了下面的代码,但它并不完美(actionscript3代码):varpat:RegExp=/(#\w{6})([^#]+)/g;varhtml:String=t.replace(pat,"$2");trace(html);//output:firstwordsecondwordthirdword如果该字符串中还有一个#,输出将不会像我想要