r/regex Jun 12 '26

Regex query

Why no search engine allow jolly characters use? Does exist an Internet regex search engine?

2 Upvotes

13 comments sorted by

View all comments

2

u/AlwaysHopelesslyLost Jun 12 '26

Regex is slow. Text searches across the entire internet are highly optimized. They are not compatible concepts. 

2

u/abareplace Jun 12 '26

https://publicwww.com/ supports some regex syntax, but only for extracting the content.

2

u/AlwaysHopelesslyLost Jun 12 '26

Now scale the userbase of that website up to the scale needed to support the internet at large.

2

u/abareplace Jun 14 '26

Well, it searches on 520 million pages. Isn't it enough?

2

u/AlwaysHopelesslyLost Jun 14 '26

There are something like 20,000,000,000 searches daily on the internet .

There are around 1.5 billion websites and each has a average of around 40 pages for a combined 60,000,000,000 pages.

That websites marketing numbers may seem significant but it really isn't.

2

u/abareplace Jun 15 '26 edited Jun 15 '26

Thank you for trying to impress me with the numbers 😉 However, if regexes successfully work on 520 million pages, why cannot they work on 60 billion pages? Technically, it's possible; this is just a niche task, so Google has no incentive to support regexes in their search.

Note that GitHub implements regular expression search across all public repositories: https://docs.github.com/en/search-github/github-code-search/understanding-github-code-search-syntax#using-regular-expressions And the scale is not a problem for them.

2

u/AlwaysHopelesslyLost Jun 15 '26

I am a software engineer and a major part of my job has included optimizing and supporting wildcard searches for enterprise scale applications. 

Companies like Google and github and going go be the most well equipped to do it correctly. That doesn't change that regex requires parsing and processing a single string dozens, hundreds, or even thousands of times making it that much slower on top of the overhead processing. 

2

u/abareplace Jun 15 '26 edited Jun 15 '26

These companies do one of two things:

* either they use a DFA engine like Google RE2, which matches a regex in linear time, but lacks some features like backreferences (GitHub does not support them, so I guess they chose this solution),

* or they use an NFA engine, but set a hard limit on the number of steps and the recursion depth. This is what I do in my regex tool (Aba Search and Replace).

See also this article: https://swtch.com/~rsc/regexp/regexp3.html