I'd like to search for phrases using regular expressions on sites such as Wikipedia and Wikimedia Commons. Is it possible to do this?

Example regex search query: (facebook|google) (corporate history|websites)

It's already possible to do the same on Google (as demonstrated here), so I want to know whether it's possible for Wikipedia as well.

  • Would you be willing to download several gigabytes of data and do all of the filtering on your own computer? – svick Aug 2 '12 at 19:46
  • It appears that is possible to do this using AutoWikiBrowser: en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/… – Anderson Green Aug 2 '12 at 19:46
  • You can use AWB to search a certain page (or a set of pages), but not the whole wiki, which I was assuming is what you wanted. – svick Aug 2 '12 at 19:48
  • Yes, I wanted to search the entire wiki. Are there any tools on the toolserver for this? – Anderson Green Aug 2 '12 at 19:50

It's available and powered by the CirrusSearch (based on ElasticSearch) which is the used search engine in the MediaWiki sites, and the Wikimedia platform.

Some usage examples:

Note: Full guide reference, and source - on Wikipedia: Help:Searching#Search_string_syntax.

As for your question:

Logical operators

The search engine supports boolean logic in searches. The logical operators include the "-" (minus sign) character for "logical not", the AND, the OR, and the grouping parentheses brackets: (_).

Logical OR must be spelled in capital letters; the AND operator is assumed for all terms (separated by spaces), but capital AND is equivalent.

More examples:

  • Simple AND, OR: "credit card" OR "payment card", "credit card" AND "payment card" - will work as expected.
  • Suffixed tilde character for fuzzy search ("sounds like") - For example, searching for charlie~ parker~ returns Charlie Parker, Charles Palmer, Charley Parks (up to two character difference, not including the first one).
  • Wildcard search - searching face*e - starts with face and ends with an e with anything in the middle. enter image description here

Extra reading

Read more about the search engine and this extension to unveil their full functionality and features.

| improve this answer | |

It is possible to search Wikipedia (or any other site that a search engine can access) using simple regular expressions, as long as you rely on an search engine. The following Google search query searches Wikipedia for matches of the regular expression (Yahoo|Google|Microsoft):


| improve this answer | |
  • A normal search with boolean operators is just a very tiny subset of regular expression search capabilities. – Pablo A Sep 6 at 20:16

If you're only interested in doing a regex search of Wikipedia titles, Crossword Nexus allows you to do that. http://crosswordnexus.com/wiki

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.