Help talk:Searching/Regex
From Wikipedia, the free encyclopedia
| This is the talk page for discussing improvements to the Searching/Regex page. |
|
Backreference
Is there a way to use Backreference (e.g. (.)\1 )? Uziel302 (talk) 20:21, 27 July 2020 (UTC)
- @Uziel302: No, that's not supported;
\1just matches a literal "1". For example, try this search. -- John of Reading (talk) 21:09, 27 July 2020 (UTC)- John of Reading, that's why I asked, and couldn't find on which level it is, mediawiki/elastic/lucene. Uziel302 (talk) 12:35, 28 July 2020 (UTC)
- Me would like to see reference for the no-support status (it may be supported with a different syntax), rather than another non-working example, too. —Mykhal (talk) 10:03, 5 October 2020 (UTC)
- @Mykhal: I'm not clear on the difference between mediawiki/elastic/lucene. Perhaps ask at WP:VPT to find someone who knows their way around the source code. I think that's the only possible reference for something not being supported. -- John of Reading (talk) 15:18, 5 October 2020 (UTC)
Dot . not matching newline
Dot
[1]
Does it really? It doesn't seem to be doing it here. For instance, . will match a newline, or any character in the targeted position\|-.*\| doesn't match the beginning of table of rows. Am I doing it wrong? — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 03:58, 19 May 2021 (UTC)
Start and end of regexp for title
There is a text on the page: Regex experts should note that ^ does not mean "beginning of text" and $ does not mean "end of text." Searching from the beginning or end of a Wikipedia page is not generally useful.
However, searching from the beginning or end of a title is useful. Can you please implement these characters for the title? Maxim Masiutin (talk) 17:41, 14 December 2023 (UTC)
- I agree, they are indeed useful. By the way, in case you aren't aware, WP:PetScan supports the regex metacharacters ^ and $; see this discussion for examples. --JAAqqO (talk) 19:28, 14 December 2023 (UTC)
Page needs updating re \n etc
Quiddity: I assume you are Quiddity of phab:T403212. AKlapper: I assume you are Aklapper of phab:T403212. Would someone please update Help:Searching/Regex to reflect these changes? I could do it myself, but if it was done by someone involved in the phab, it's more likely to be the truth, the whole truth, and nothing but the truth. —Anomalocaris (talk) 21:03, 26 December 2025 (UTC)
- @Anomalocaris Hi, I cannot spend my limited time on updating random pages on potentially hundreds of wikis after potentially hundreds of wiki communities decided to write their own search documentation which duplicates efforts and obviously gets outdated at some point. I believe that linking to canonical documentation on mw:Help:CirrusSearch is the most sensible "updating". I believe that keeping that one single page on mediawiki.org up-to-date as a shared effort is the most sensible approach. Resources are not unlimited. :) (Disclaimer: I do not work on Search stuff, and this is my very personal opinion.) AKlapper (WMF) (talk) 12:06, 27 December 2025 (UTC)