Page MenuHomePhabricator

Allow ^ and $ in intitle regex search
Open, MediumPublicFeature

Description

It would be nice to be able to use ^ for the beginning of the title and $ for the end of the title in regular expression searches of titles (intitle://).

At the moment there's no way to search for titles ending with gry as was recently brought up in a discussion on categories for words with suffixes that are not really suffixes on English Wiktionary. intitle:/gry$/ doesn't work. Years ago @Dixtosa created https://dixtosa.toolforge.org to do searches like this.

For prefix searches, Special:PrefixIndex works if you've got a literal prefix that narrows things down, but for anything more complicated you really need insource:/^/.

My impression is that ^ and $ were disabled in insource:// searches because it's unclear whether they mean start of line and end of line, or start of text and end of text, and maybe for performance reasons, but neither thing would be a consideration in titles, which don't have newline characters and can only be 255 bytes long. So intitle:// should be able to use ^ and $.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
MPhamWMF moved this task from needs triage to Feature Requests on the Discovery-Search board.

I join this request. There is a workaround for the exact case you mentioned which goes intitle:/[a-z]gry/ -intitle:/[a-z]gry[a-z]/. But that won't work when you need to exclude, not include some ending (so you start with -intitle:/[a-z]gry/). In my use case, I need to exclude translation pages like "API:Search and discovery/ja" from search formatversion insource:/formatversion['"]?: ['"]?2/ on mediawiki.org. The best I can do is to use -intitle:/\/[a-z-]+/ which can have false positives.