Wikipedia:Tip of the day/January 2

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Searching Wikipedia titles with grep

Grep is a tool available on Wikipedia's toolserver.

It has three major abilities/features:

  1. It searches page titles only
  2. Its displays results as a single-column list
  3. It understands regular expressions (for a cheatsheet, see WP:REGEX)

You don't have to worry about Regex to be able to use it. Just type in a term or phrase you want it to search for.

To specify more than one search string in the same search, use (|), like this:

(of Colorado|in Colorado)

That returns a list with titles like Geography of Colorado, Education in Colorado, etc.

Grep also takes spaces into account...

" Colorado" (without the quotes) would look for "Colorado" with a space character in front of it.

To find places in Colorado, search for ", Colorado" (though that won't find all of the places).

To look for a search string that includes parentheses, you have to escape the special meaning of the parentheses characters by placing a backslash in front of each.

Grep is a nice simple place to start experimenting with Regex. Once you get familiar with it, you'll be ready to apply Regex in WikEd and AWB.

Prior tip - Next tip