Will Google implement the ability to search with regular expressions?
Articles,  Blog

Will Google implement the ability to search with regular expressions?


Hi, everybody. Today’s question comes from
Stockholm, Sweden. Jimmy wants to know, “Will
Google offer the feature to search with regular
expressions? When, or why not? I feel that sometimes you really
want to be able to write very specific search
queries where the normal operators and operands
aren’t enough.” Great question, Jimmy. I tend to agree with you. Unfortunately, the number of
people who really want to search with regular expressions is vanishingly small. And the amount of infrastructure
and extra indexing space that it would
take is quite large. So, for example, when we started
to offer numb range searches, which you
can still do. You can search for Mount
Everest, feet high, and then you can search for 29,000
dot, dot, dot, or dot, dot to 32,000. And it will search for anything
in that number range. That’s a really neat power-user
function, but it takes a significant amount of
index space to be able to support that. It’s not huge, but it’s
definitely not trivial. So not enough people really have
asked to be able to the search with regular
expressions. On the bright side, if you
ever want to get a job at Google, you can run a MapReduce
over the entire web, and then you can write your own
regular expressions and search over the content of
stuff that we’ve crawled pretty easily. But at least to be able to
surface that to the sort of people who do over a billion
searches a day, it would take enough indexing and
infrastructure capacity when it’s probably not worth it
as far as building the amount of work in. So I wouldn’t expect that any
time soon, sorry to say.

38 Comments

  • Die1101

    @blank000 The problem is that there aren't enough users as it is, considering the amount of development and indexing space that it would require. You're asking that they develop and limit access to even fewer users?

  • Die1101

    Maybe not something as complex as regular expressions, but a few more power operators would be nice. For example, I can't search Google for exactly "A.C." and nothing else without it displaying results for AC, A/C, Air Conditioning, Alternating Current, etc.

  • Jimmy Wirsborg

    Fair enough, thanks for the answer though =)
    Guess I'll dive straight in and try to solve it ;P
    Where do I send my application for that job offer when I'm done btw?

    Those who say you can't get in touch with Google are so wrong… you just need to find the right forum… =)

  • DrPokiaka

    Saying it's not worth it is just wrong.. If only a small number of people want it like he said, it's only because the rest aren't aware what it is. If they were, I'm pretty sure everybody would want to learn how and it would be used constantly.

  • nullzero89

    It could be a paid option, with payment proportional to computing power usage. Just like cloud computing.
    And no Google Ads. 🙂

  • Webbs Kruiser

    It's not worth it due to the huge amount of work that needs to be put into this. It just doesn't pay off. Also, imagine the amount of bugs.

    Regexp is relatively complex enough that tons of people won't ever bother with it. Heck, several file managers support regexp for searching files on your own computer, and they aren't nearly as popular as they should be…

  • DrPokiaka

    Implementation would be pricey in these scale, granted, and that's really an issue. Other than that there are so many libraries and some of them are as tested as they can get and about the complexity.. I completely agree and in my honest opinion I think regex should be simplified, which is possible. Other than that if regex as it is will get promoted it can definitely become natural to use, and used widely by all power users. I do dare to dream that far but.. yeah I think it's worth it overall..

  • William Wyatt Earnshaw

    Could Google implement a really inefficient version for the vanishingly small userbase that does want it? 😀

  • sinekonata

    Which search engine does offer this? At least for some websites. Meaning is there some developer search engine?

  • Dont be evil.

    Not enough people ask for it? Just in case you didn't have me on your list: I do ask for it.
    Also i would be pretty happy if you would at least take seriously what I type into the search engine. There are a ton of special characters and google treats them all the same or even ignores them completely. :/ Even putting quote sighns arround it doesn't change this most of the time.

  • hangugeohaksaeng

    I understand that implementing this feature might not be feasible at this time, but why laugh at the mere idea of it (7-8 seconds into the video you laugh while reading the question). Regex is not some casual esoteric hobby. +1 vote for regex

  • Kristjan Link

    I also would love the feature to search with regular expressions… Too many times have I wanted to do it only to remember that I can't…

  • David Walsh

    “If you ever want to get a job at Google, you can run a MapReduce over the entire web… and then you can your own regular expressions and search over the content of stuff that we’ve crawled pretty easily…”

    This comes across an automotive engineer suggesting you satisfy your need by starting a car company.

  • Gogh von Johann

    I'd actually already be happy if you could do exact searches which – while certainly somewhat related to regex, is not full regex. This would be really useful to distinguish results where 'foo-bar' is not the same as 'foo bar' and 'fooBar' not the same as 'foobar'. Presumably the effort required to do this isn't worth it, but it would be really cool.

  • s4nathan1

    Ask this question to Bing Search Engineer at Microsoft. The response would have been something along the lines of: "What is regex?" Or "Ms does not believe regex to be a deciding factor in the search engine technology". Not any real answer for sure. They might include it once other search engines have already implemented it and claim it's the best thing since sliced bread.

  • Andrew

    There are 2 main reasons:
    1/. It would be fairly resource intensive for Google to support regular expressions in search.
    2/. It will only be useful for the very, very small fraction of users who know how to use regexes.

Leave a Reply

Your email address will not be published. Required fields are marked *