Help talk:Searching/Regex
Add topic| This is the talk page for discussing improvements to the Searching/Regex page. |
|
Backreference
[edit]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
[edit]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
[edit]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
[edit]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)
- @Quiddity, @AKlapper (WMF), @Anomalocaris, you should have seen by now that I have replaced the entire contents of this help topic with a soft redirect to the MetaWike article mentioned above. I hope this meets everyone's purpose. Kiwipete (talk) 05:14, 26 April 2026 (UTC)
- That seems sensible to me. Centralization of docs helps everyone in all languages, as AKlapper said above. Build the web. Thanks. Quiddity (talk) 06:58, 26 April 2026 (UTC)
- I see that my change has been reverted by @Mathglot, claiming "Insufficiently discussed." I don't know why the discussion above is insufficient, of if not, why it was not continued here. Kiwipete (talk) 09:31, 27 April 2026 (UTC)
- It is being continued here. I agree with general principles of maintaining a single source but I believe we have a ways to go before we get there in this instance. This page is a subtopic of the mw page's topic, but a large one and imho the topic of Cirrus regex deserves its own page. There is unique information on this page, and any redirect or soft 404 would need to take that into consideration and involve a merge to prevent loss of information. In the meantime, I plan to continue improving this page as a model of how a Cirrus regex page ought to be on mw and have begun to do so already. I agree that no one should spend their time duplicating efforts in hundreds (or even two) wikis on the same topic. I also agree with Aklapper that keeping the mw copy up to date and useful is a great idea, and I hope that volunteers will continue to improve that page; maybe it will get to the point where this one is no longer needed. In the meantime, I would like to make this one better, to the point where it will be a model for improvements at mw, and once that happens, I will support a merge and soft redirect. I think we are about a year away from that. Mathglot (talk) 17:24, 27 April 2026 (UTC)
- I see that my change has been reverted by @Mathglot, claiming "Insufficiently discussed." I don't know why the discussion above is insufficient, of if not, why it was not continued here. Kiwipete (talk) 09:31, 27 April 2026 (UTC)
- That seems sensible to me. Centralization of docs helps everyone in all languages, as AKlapper said above. Build the web. Thanks. Quiddity (talk) 06:58, 26 April 2026 (UTC)
- @Quiddity, @AKlapper (WMF), @Anomalocaris, you should have seen by now that I have replaced the entire contents of this help topic with a soft redirect to the MetaWike article mentioned above. I hope this meets everyone's purpose. Kiwipete (talk) 05:14, 26 April 2026 (UTC)