问题描述
我正在尝试更换span标签,因为第三方报告工具中的问题会修剪空格。
I am trying to replace the span tags as the spaces are trimmed due to problem in third party reporting tool.
所以html看起来像< span style =" mso-bookmark:OLE_LINK1">我希望它替换为< span>& nbsp; 但不知怎的,它不起作用。我的输入字符串是单词的长字符串,我喜欢替换所有出现。
So the html looks like <span style="mso-bookmark: OLE_LINK1"> and I want it replace with <span> but somehow it is not working. My input string is long string from word and I like to replace all occurances.
我的代码看起来像这样......
my code looks like this...
myComment = Regex .Replace(myComment, "< span style = \" mso-bookmark :OLE_LINK [^>] *" , "< span>& nbsp;" , RegexOptions .Multiline | RegexOptions .IgnoreCase);
myComment= Regex.Replace(myComment, "<span style=\"mso-bookmark: OLE_LINK[^>]* ", "<span> ", RegexOptions.Multiline|RegexOptions.IgnoreCase);
是否有正则表达的专家可以提供帮助。
is there any expert of regex who can help.
谢谢提前
thanks in advance
推荐答案
这篇关于正则表达式替换不起作用< span style =" mso-bookmark:OLE_LINK1">的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!