Topic on Extension talk:Replace Text

Spiros71 (talkcontribs)

I am trying to delete some templates with their content. I have gone as far as using something like:

 {{WoodhouseENELnames\n(.*?)\n}}

Which only captures text in the template if there is one line break after the template name and another before the end of template. How can I edit this so that it captures any text and any number of lines until it reaches the first "}}" bit (non-greedy)?

Jonathan3 (talkcontribs)

Just get rid of \n in both places - try

{{WoodhouseENELnames(.*?)\}\}
Spiros71 (talkcontribs)

"No pages were found containing the string "\{\{WoodhouseENELnames(.*?)\}\}" or "{{WoodhouseENELnames(.*?)}}" I guess multiline is not supported by simply using ".*?"

So far the only workaround I found is using multiple expressions like:

{{WoodhouseENELnames\n(.*?)\n+(.*?)\n+}} 
 {{WoodhouseENELnames\n(.*?)\n+(.*?)\n+(.*?)\n+}} 
 {{WoodhouseENELnames\n(.*?)\n+(.*?)\n+(.*?)\n+(.*?)\n+}} 
Jonathan3 (talkcontribs)

It seems that you need to escape } but must not escape { in ReplaceText. Try it again :-)

Spiros71 (talkcontribs)

That did not work either:

No pages were found containing the string

{{WoodhouseENELnames(.*?)\}\}
Jonathan3 (talkcontribs)

I was sure I'd tried it, but clearly not. Sorry.

Reply to "Multiline replace"