标签:ima pat 替换 img cti return strong log 正则
content = "<p><strong>发斯蒂芬斯</strong>蒂芬434324</p><p><strong>范德萨发</strong>的发斯蒂芬</p><p><strong>242<b>3423</b>423</strong></p>"; console.log(content); var pattern = /([\u4e00-\u9fa5]|[^<>])+(<[^>]+>)+([\u4e00-\u9fa5]|[^<>])+(<[^>]+>)/g; content = content.replace(pattern,function($1){console.log($1);return $1.replace(/<[^>/]+>/g,‘‘)});//替换不规范文本 console.log(content);
标签:ima pat 替换 img cti return strong log 正则
原文地址:http://www.cnblogs.com/BeautyFuture/p/6047950.html