[英]regular-expression for mediawiki replace ==
I am using mediawiki and I have the text 我正在使用mediawiki,并且有文字
<div class="list-block"> == 2014 and beyond == <div id="list">My best day </div></div>
I'm using the regular expresion: <div class="list-block"> == 2014 and beyond == <div id="list">My best day </div></div>
我正在使用常规表达式:
%<div class="list-block"[^>]*>\n?<h2>(.+)</h2>\n?(<div id="list">)?(.*)(</div>)?\n?</div>\n</div>%sU
and it isn't working. 而且它不起作用。 It originally had <div class="list-block">''' 2014 and beyond'''<div id="list">My best day </div></div>
and the %<div class="list-block"[^>]*>\\n?<b>(.+)</b>\\n?(<div id="list">)?(.*)(</div>)?\\n?</div>\\n</div>%sU
which worked great. 它最初具有<div class="list-block">''' 2014 and beyond'''<div id="list">My best day </div></div>
和%<div class="list-block"[^>]*>\\n?<b>(.+)</b>\\n?(<div id="list">)?(.*)(</div>)?\\n?</div>\\n</div>%sU
效果很好。 I switched the <b>
with the <h2>
and now it isn't working. 我用<h2>
切换了<b>
,但现在不起作用。 Any idea what I am doing wrong? 知道我在做什么错吗? (I don't mind removing the <h2>
tags altogether but that doesn't work either). (我不介意完全删除<h2>
标记,但这也不起作用)。
'%<div class="list-block"[^>]*>\n?<h2>(.+)</h2>\n?(<div id="list">)?(.*)(</div>)?\n?</div>\n</div>%sU'`
现在正在工作,我不确定是什么问题,它可能是mediawiki格式问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.