Topic on Extension talk:Replace Text

YOUR1 (talkcontribs)

When you got the following text on a page

{{#ask|bleep=lol|?=#=Foobar|asdasd}}
{{#ask|?=#=Foobar da}}

and use search/replace values with regex enabled: ((\?=#=([a-zA-Z0-9_ ]*))) => ?=$3#

the text becomes

{{#ask|bleep=lol|?=#Foobar|asdasd}}
{{#ask|?=#Foobar da}}

instead expected text:

{{#ask|bleep=lol|?=Foobar#|asdasd}}
{{#ask|?=Foobar da#}}

Any workaround for this?

MvGulik (talkcontribs)

It seems to me your running into the sames issue I explored here

Ciencia Al Poder (talkcontribs)

Because [a-zA-Z0-9_ ]* ends in an *, it means zero or more. Apparently, the regexp is lazy and blindly stops at "zero" matches, meaning it matches only ?=#= and not any more text.

You should add another character after that expression that must be present, for example |:

((\?=#=([a-zA-Z0-9_ ]*\|)))
Reply to "Possible bug"