Template:Regex/doc

This template helps field the details in the wikitext of any page on the wiki. Normally searches ignore non-alphanumeric characters, but regular expressions (regex) accept all characters, plus metacharacters.

This template acts as a doorway by helping to develop a database query before running it on the wiki, and it does this by way of a search link that can also be used to share such discoveries. This template can also be used to learn the regular expression syntax of this version of Cirrus Search. You could use a bare {{search link}} to do all this, but this template saves a lot of typing (see below), so you only need to focus on entering a regexp.

An important alternative to using this template is performing a search directly with insource:"quotes-delimited arguments". These find wikitext without resorting to the regex searches this template does with insource:/slash-delimited arguments/, (which is a common syntax for regex searches). See § About CirrusSearch below for a better understanding of when this template is not needed. See below for other search tools.

Regular expressions are little computer programs, so it is characteristic of regex searches that they must always be tested to achieve their potential precision and thoroughness. But only a few of these intensive searches are technically able to run at a time against the database. This template minimizes your footprint, and guarantees that you will never run an untested regexp on every namespace in the wiki, even if your default search would let you do that. Use of this template enables the smallest possible footprint by using filters to limit the search domain. The first domain it targets is its own page in an ad hoc sandbox. Once your regexp pattern is honed, you add a search domain, by setting |prefix=.