60

It would be very useful if Google provided a regular expression search.

Is there a way to do this?

(OBS: I am not talking about false regular expressions like site:, filetype:, AND, OR or "Text". I would like to search with a regular expression like .+[]^).

For example, is there an application, a site or a Google tool to search things like *.stackexchange?

migrated from webmasters.stackexchange.com Oct 8 '11 at 22:00

This question came from our site for pro webmasters.

24

This feature is not available in classic Google Search and it's not in Google's roadmap. You can learn more about this topic watching the Google video Will Google implement the ability to search with regular expressions?

However, there's one exception. Google Code Search supports regular expressions. Of course, the search target for this topic search engine is reduced to source code only.

It is worth to mention that some Google search keywords can partially replace regular expressions. For example, if you want to search any two-word variation of "search TERM", you can use the wildcard operator.

search *

will find results for search and any other (one) word. I often use it to check basic English grammar rules or synonyms (e.g., "as easy as *").

11

Google Search can return the matches of some simple regular expressions. For example, the search query

"(gray|red) (wolf|fox)"

appears to be equivalent to

("gray wolf" OR "red fox" OR "red wolf" OR "gray fox")

You can see the output of this search query here.

  • I am searching for a medicine or chemical name. I can read "heme ??llnate" - where the question marks are illegible. Google can't help. – SDsolar Oct 11 '17 at 1:09
7

SymbolHound has an open source code repository search, similar to the now-discontinued Google Code Search option, in addition to a symbol-inclusive web search that indexes programming-related sites such as Stackoverflow.

  • 1
    If you are affiliated with SymbolHound please can you state this in your profile. Thanks! – codingbadger Jan 20 '12 at 11:18
5

You can write a piece of software to:

  1. Take the keywords from the regular expression;
  2. Google the keywords and get a list of results;
  3. Crawl each resulting URI and filter it with complete regular expression.

Let's study a case: from site:gog.com find all games that have Spanish voice-over.

The regular expression is:

Audio[^:]*:[^.,]*Spanish

It shall match, for example:

Audio lanuage: English, German, Spanish, French.

And not match:

Audio language: only-English. Text language: Spanish.

Step 1. Let your software search this on Google:

site:gog.com audio Spanish inurl:game

inurl:game here means only search in game description pages

Step 2. Get the 300 resulting links and crawl into every one of them.

Step 3. Filter the result with the given regular expression:

Audio[^:]*:[^.,]*Spanish

This should be easy to build. In fact I don't understand why I couldn't find something that is already built that way.

Since search engines can't afford the resource to scan their data with regular expression, this dirty job falls on your part, and your computer should do that with what search engines already provide.

  • +1. Thx a lot. This is a very interesting idea, in fact. The main problem is that we probably will need high performance clusters to do something really interesting. – GarouDan Oct 25 '13 at 19:05
  • Heh, I'm writing this extension right now. – Navin Nov 2 '14 at 10:10
4

No, unfortunately not :(. In theory you could make your own search engine and do it, but that would be pretty hard.

1

Just for reference, Google's help on search operators is here.

Interestingly, "-" is still an operator for word exclusion, but they removed "+" as an operator, used in the past to require a given search term. Apparently, "The + operator was retired when Google+ was launched, because + was needed as a searchable character rather than an operator."(https://support.google.com/websearch/answer/2466433)

0

You could start with a detailed Google search to cull the target text to search. Then open, say, the top 50 results in multiple tabs and use mingyi's "Fastest Search" Firefox addon to search the results using a regular expression.

-3

Google now supports and fully documents the use of RegEx. Here is the link for reference:

http://www.google.com/support/enterprise/static/postini/docs/admin/en/admin_ee_cu/cm_regex.html

  • 4
    That's only for Postini. – ale Dec 27 '13 at 16:24
-3

If you know VBA, you can write some code to get data from the web to Excel. I run the program day and night and can get millions of results. After that you can filter from those results.

  • 2
    oh, god... forgive our sins – beppe9000 Jul 25 '16 at 19:49

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.