Live data from Hacker News

DuckDuckGo Regex Search

duckduckgo.com

11–20 of 36 posts

Re: DuckDuckGo Regex Search

#11
post #3

Google does not implement regex search support because they said somewhere that the data storage needed for the index would be huge. And since regex search is used only by a small subset of users, it is not worth the effort.

This does not do what you think it does. It takes a regular expression and an input and applies that regular expression to that input. It doesn't search the web using the regex.

Re: DuckDuckGo Regex Search

#12
Every comment here at time of writing is from people thinking that this is a way of searching the web using regular expressions. It is not.

It is a way of taking a regular expression and an input and then applying that regular expression to that input. In this particular example it takes the regular expression:

/(?x: (\w+) \s (\w+) )/

And applies it to:

"hacker news"

And then spits out the result:

"hacker | news"

Representing the two captured results.

Re: DuckDuckGo Regex Search

#14

Every comment here at time of writing is from people thinking that this is a way of searching the web using regular expressions. It is not. It is a way of taking a regular expression and an input and then applying that regular expression to that input. In this particular example it takes the regular expression: /(?x: (\w+) \s (\w+) )/ And applies it to: "hacker news" And then spits out the result: "hacker | news" Rep…

What is the use for this?

Re: DuckDuckGo Regex Search

#15

Every comment here at time of writing is from people thinking that this is a way of searching the web using regular expressions. It is not. It is a way of taking a regular expression and an input and then applying that regular expression to that input. In this particular example it takes the regular expression: /(?x: (\w+) \s (\w+) )/ And applies it to: "hacker news" And then spits out the result: "hacker | news" Rep…

What is the use for this?

Testing regular expressions

Re: DuckDuckGo Regex Search

#17

Every comment here at time of writing is from people thinking that this is a way of searching the web using regular expressions. It is not. It is a way of taking a regular expression and an input and then applying that regular expression to that input. In this particular example it takes the regular expression: /(?x: (\w+) \s (\w+) )/ And applies it to: "hacker news" And then spits out the result: "hacker | news" Rep…

Thank you. Can you explain what "?x:" does? Searching for regular expressions syntax (another thing this doesn't do) is quite tricky.

Re: DuckDuckGo Regex Search

#18

Doesn't appear to work for me .. is this supposed to be doing a regex search or just solving; doesn't seem to solve generally?

It does; try:

https://duckduckgo.com/?q=regex+%2Fhack%2F+hacker+news

https://duckduckgo.com/?q=regex+%2F%28hack%29%2F+hacker+news

Re: DuckDuckGo Regex Search

#19

Doesn't appear to work for me .. is this supposed to be doing a regex search or just solving; doesn't seem to solve generally?

It does; try: https://duckduckgo.com/?q=regex+%2Fhack%2F+hacker+news https://duckduckgo.com/?q=regex+%2F%28hack%29%2F+hacker+news

Although, admittedly, this [1] doesn't do what I'd expect it to.

[1] https://duckduckgo.com/?q=regex+%2F%28%5Cw%2B%29+%5Cs+%28%5C...

Re: DuckDuckGo Regex Search

#20

Every comment here at time of writing is from people thinking that this is a way of searching the web using regular expressions. It is not. It is a way of taking a regular expression and an input and then applying that regular expression to that input. In this particular example it takes the regular expression: /(?x: (\w+) \s (\w+) )/ And applies it to: "hacker news" And then spits out the result: "hacker | news" Rep…

Thank you. Can you explain what "?x:" does? Searching for regular expressions syntax (another thing this doesn't do) is quite tricky.

It's another way of specifying a regular expression modifier, normally given at the end of a regex.

In this case, 'x' means "Extend your pattern's legibility by permitting whitespace and comments"

Post reply on HN