Topic on Talk:VisualEditor

Backreferences for regular expressions

6
DonBarredora (talkcontribs)

Can I make a backrefence to a captured group when using the search and replace function?

Whatamidoing (WMF) (talkcontribs)

I don't think I understand this question. Do you have a diff, or can you show me in wikitext what you want to do? (If you start typing <pre then this discussion tool with automagically guess that you want to add some code to the page. But visit my user talk page if it's easier to post the wikitext there.)

DonBarredora (talkcontribs)

Suppose I enter the following regular expression in the search box:

(0-9)+

I would like to know if it's possible to reference that captured group in the replace box, like:

\1

Thank you.

Jdforrester (WMF) (talkcontribs)

Yes, captured groups are referenced using $1, $2, etc..

190.190.135.175 (talkcontribs)

That's what I wanted, thanks for the help.

ESanders (WMF) (talkcontribs)