我有这样的样本串,我想有一个开口,以取代明星和关闭使用JavaScript的正则表达式较强的触杀:正则表达式替换字符的HTML标签
To increase search results, use the 8** prefix.
877 and 866 will result in more matches than 800 and 888 prefixes.
*Note*: The pattern for a custom number can be more than 7 digits. For example: 1-800-Mat-tres(s)
理想的输出将是:
To increase search results, use the 8** prefix.
877 and 866 will result in more matches than 800 and 888 prefixes.
<strong>Note</strong>: The pattern for a custom number can be more than 7 digits. For example: 1-800-Mat-tres(s)
唯一需要注意的是,如果连续有两个开头(如8 **),那么它们不会被强标签取代。
非常感谢您的帮助。
你有没有在自己所有尝试新鲜事物? – 2012-03-28 22:32:00
@AdamZalcman好点。我需要更多地鼓励。 – Kyle 2012-03-28 22:40:28
是的,我试过 var thisContent = thisContent.replace(/\*(.*?)\*/ g,'$&'); – SkyOut 2012-03-29 13:38:36