如何用 StringRegExpReplace 把以下字串不用部分去掉?
有如下代码:<!-- InstanceBeginEditable name="201804" -->This is aTestany more
<!-- InstanceEndEditable -->
要实现最终效果是(也就是 This is a Testany more 要去掉):
<!-- InstanceBeginEditable name="201804" --><!-- InstanceEndEditable -->
请问用 StringRegExpReplace 如何去掉?
本帖最后由 yuantian 于 2018-6-24 22:25 编辑
Local $a = '<!-- InstanceBeginEditable name="201804" -->This is aTestany more' & @LF& '<!-- InstanceEndEditable -->'
Local $b = StringRegExpReplace($a, ">(.*\n)", ">",0)
MsgBox (0,"" ,"原字符串:" & @CRLF & $a & @CRLF & "新字符串:" & @CRLF & $b)
不知道这种方式适不适合你??
找帮助文件已解决了。 StringRegExpReplace($sRead,'(*ANY)(?s)' & $year_tmp & '(.*?)' & '<!-- InstanceEndEditable -->', $year_tmp & '<!-- InstanceEndEditable -->',0)
页:
[1]