[HN Gopher] Searching for "notepad" on DuckDuckGo yields zero re...
       ___________________________________________________________________
        
       Searching for "notepad" on DuckDuckGo yields zero results
        
       Author : massinstall
       Score  : 66 points
       Date   : 2023-09-05 19:24 UTC (3 hours ago)
        
 (HTM) web link (duckduckgo.com)
 (TXT) w3m dump (duckduckgo.com)
        
       | snerc wrote:
       | What causes this?
        
         | massinstall wrote:
         | I have no idea, but equally curious.
        
         | superhumanuser wrote:
         | They used to have this thing where developers could build
         | Instant Answers through a program called DuckDuckHack.
         | 
         | It would load a carousel at the top with results for like jobs,
         | recipes, etc.
         | 
         | It used regex to match the search query. Looks like they have a
         | bad one.
        
       | nipperkinfeet wrote:
       | I feel like Google has the same issue. Nowadays, searching for
       | anything on Google yields between 3 and 17 results. Few years
       | ago, I received millions of results for the same searches.
        
       | notorandit wrote:
       | "Windows os" instead yields just nonsense
        
       | sys32768 wrote:
       | For that query, the Chrome developer tools console spits an error
       | like so:
       | 
       | >d.7527c434450544045365.js:1 Uncaught (in promise) SyntaxError:
       | Invalid regular expression:
       | /^(https?://)?([\w\\.-_]*\\.)?notepad++\\./: Nothing to repeat
       | (at
        
         | Svip wrote:
         | Was someone trying to be funny, to change a "notepad" search
         | for "notepad++", forgetting that + has a specific meaning in
         | regex? Same error occurs with a search for "notepad++", though,
         | but not "notepad+", funnily enough.
        
           | dylan604 wrote:
           | wouldn't this be worse for not having the user provided
           | search query sanitized for special characters?
        
             | Svip wrote:
             | My assumption is wrong. As others have noted, it's clearly
             | parsing the title of the first result wrong. Edit: It's the
             | parsing of the title of the infobox.
        
         | badrabbit wrote:
         | Looks like a regex to detect notepad++ in a url that didn't
         | escape the +'s? Weird, maybe a sponsorship thing
        
           | jzig wrote:
           | Yep they need to escape every character in the string not
           | just the plus signs
        
         | jzig wrote:
         | If you set a breakpoint there, the value it is trying to
         | replace is "Notepad++" rather than "notepad", gotten from the
         | Heading of "http://www.notepad-plus-plus.org" further up in the
         | logic chain. Looks like the plus signs are incorrectly being
         | added to the RegEx
        
       | keb_ wrote:
       | Unrelated to this issue, but I get peeved when HN commenters rave
       | how DuckDuckGo results are far superior to Google's, and yet the
       | other day I entered "DuckDNS" on DDG, and it was nowhere to be
       | scene in the top 3 pages. Meanwhile on Google and Brave Search,
       | it is the first result.
        
       | letmevoteplease wrote:
       | Seems to happen with any query containing "otepad".
        
         | devonnull wrote:
         | Unless you type in something like _Windows Notepad_ or _paper
         | notepad_ , which does return results.
         | 
         | Strange, very strange.
        
         | Mountain_Skies wrote:
         | As does "tepad" though "epad" does return results.
        
       | yegg wrote:
       | Hi all (CEO & Founder, DuckDuckGo here). Looks like something may
       | have broken in a release that went out today -- it is triggering
       | a JS error. We're looking into it now and should have it resolved
       | soon.
       | 
       | UPDATE: this should be fixed now.
        
         | marginalia_nu wrote:
         | I feel like the crowd of e-rubberneckers that gathered here
         | made it seem like a bigger bug than it was...
        
         | Gerard0 wrote:
         | Hello! Why has DDG gotten so worse lately? I thought it was
         | just me but I keep reading the same experience on HN. There is
         | no way you don't know about this?
         | 
         | Asking as a long time user and at a time even DDG evangelist.
         | 
         | Cheers!
        
           | Brian_K_White wrote:
           | I signed up for Kagi finally. Still figuring out if it's
           | worth it, but the more important thing is that I was moved to
           | even consider it and do it.
        
         | pbhjpbhj wrote:
         | Fixed for me (UK), would be interesting to hear what the error
         | was. I did so love the time when you were developing DDG and
         | posting to HN about your progress and getting suggestions from
         | the community and whatnot. So glad it worked out for you.
        
           | yegg wrote:
           | Thanks! It was a regex error.
        
             | throwitaway156 wrote:
             | Similarly to DNS, its always regex.
        
         | daqhris wrote:
         | Thanks for acknowledging it and sharing helpful info. It seemed
         | bizarre for a short moment.
        
       | 1vuio0pswjnm7 wrote:
       | Using POST, HTTP/1.0 and lite.duckduckgo.com, with no Javascript
       | of course, I got results. Not suggesting any of those are
       | requirements. I'm just reporting that the no results experience
       | is not universal.
       | 
       | Here is the first page of results:
       | https://notepad-plus-plus.org/
       | https://onlinenotepad.org/notepad
       | https://apps.microsoft.com/store/detail/9MSMLRH6LZF3?hl=en-
       | us&gl=US       https://notepad-plus-plus.org/downloads/v8.5/
       | https://sourceforge.net/projects/notepadplusplus.mirror/
       | https://notepad.js.org/       https://notepad-plus-
       | plus.org/downloads/v8.1.9.3/       https://notepad-plus-
       | plus.org/downloads/v8.1/       https://support.microsoft.com/en-
       | us/windows/help-in-notepad-4d68c388-2ff2-0e7f-b706-35fb2ab88a8c
       | https://www.techspot.com/downloads/2010-notepad.html
       | https://github.com/notepad-plus-plus
       | https://www.onlinenotepad.io/       https://anotepad.com/
       | https://www.howtogeek.com/902619/open-notepad-in-windows/
       | https://notepad.plus/       https://community.notepad-plus-
       | plus.org/       https://www.digitalcitizen.life/start-notepad-
       | windows/       https://notepad.uptodown.com/windows
       | https://www.dictionary.com/browse/notepad       http://www.my-
       | notepad.net/       https://notepad.id.uptodown.com/windows
       | https://notepad-classic-windows-10.en.softonic.com/
       | 
       | Below is a quick script for DuckDuckGo searching, if only want
       | first page of results. yy025 makes HTTP from URLs. yy046 URL-
       | encodes input, e.g., "+" to %2B. The address 127.22.10.55 is a
       | TLS forward proxy.                        usage: echo query
       | string|1.sh > 1.htm                     firefox ./1.htm
       | links -no-connect ./1.htm                       #!/bin/sh
       | h=duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion
       | h=lite.duckduckgo.com              read x;
       | x=q=$(echo "$x"|yy046);              export httpMethod=POST;
       | export Content_Type=application/x-www-form-urlencoded;
       | export Content_Length=${#x};              export httpVersion=1.0;
       | export Connection=close;              echo
       | https://$h/lite/|yy025|if sed w/dev/stderr;then
       | echo $x;echo $x >&2;fi \              |socat stdio,ignoreeof
       | tcp:127.22.10.55:80
        
       | jampa wrote:
       | It seems that anything that returns "++" (EDIT: in the "About"
       | box), in this case "Notepad++", breaks their internal regex
       | because it seems not to be sanitized properly
       | 
       | The breaking code using chrome dev tools seems to be:
       | 
       | n = new RegExp("^(https?://)?([\\\w\\\\.-_] _\\\\.)? " +
       | o.toLowerCase().replace(/[-\s]/g, "") + "\\\\.");
       | 
       | In this case "o" is "Notepad++" which might be the first result.
       | 
       | The browser returns this error:
       | 
       | Invalid regular expression:
       | /^(https?://)?([\w\\.-_]_\\.)?notepad++\\./: Nothing to repeat
       | 
       | Also happens with C++
       | https://duckduckgo.com/?q=c%2B%2B&t=ffab&ia=web
        
         | Svip wrote:
         | Curious that the error does not occur when searching for
         | "Notepad+":
         | https://duckduckgo.com/?q=notepad%2B&t=ffab&atb=v101-1&ia=we...
        
           | jampa wrote:
           | In this scenario all the "o" instances are "Notepad+".
           | 
           | The error seems to be coming from the right sidebar which
           | displays "Notepad+" as a title as well. It seems to be
           | getting the "Heading" from the wikipedia page
           | 
           | Here is the object where it extracts the heading from, it
           | seems in this scenario it is not extracting "Notepad++" in
           | the about but "Notepad+" which is another application.
           | 
           | ```
           | 
           | Abstract: "Notepad+ is a freeware text editor for Windows
           | operating systems and is intended as a replacement for the
           | Notepad editor installed by default on Windows. It has more
           | formatting features but, like Notepad, works only with plain
           | text. It can open text files of any size, and a single
           | instance of the program can have multiple files open
           | simultaneously. It supports dragging and dropping text within
           | a file and between files, and supports multiple fonts and
           | colours. Notepad+ is available from the company RogSoft. It
           | was developed by Dutch programmer Rogier Meurs. It was first
           | released in 1996. Originally, it had the advantage of being
           | able to open files of any size, because until 2000 Notepad
           | could not open files larger than 64 KB." AbstractSource:
           | "Wikipedia" AbstractURL:
           | "https://en.wikipedia.org/wiki/Notepad%2B" Heading:
           | "Notepad+"
           | 
           | ```
        
           | cypherpunks01 wrote:
           | It's because a single plus '+' is valid in a regex. A double
           | plus '++' is invalid.
        
         | Groxx wrote:
         | "cpp" seems to work fine though, and returns many results that
         | include "c++"... https://duckduckgo.com/?q=cpp&t=ffab&ia=web
        
           | [deleted]
        
           | SirMaster wrote:
           | But "c plus plus" breaks
        
         | chrismorgan wrote:
         | Corroborating this to some extent, the "HTML" and "lite"
         | versions works fine in both cases:
         | 
         | https://html.duckduckgo.com/html/?q=notepad
         | 
         | https://html.duckduckgo.com/html/?q=c%2B%2B
         | 
         | https://lite.duckduckgo.com/lite/?q=notepad
         | 
         | https://lite.duckduckgo.com/lite/?q=c%2B%2B
        
         | cypherpunks01 wrote:
         | It's not quite _anything_ that returns a  '++', but I think any
         | search term that creates a '++' (or perhaps any invalid regex
         | syntax) inside the main info box result.
        
         | vikingerik wrote:
         | Speaking of control characters breaking things, HN ate the *
         | characters in your post and turned the text into italics
         | instead.
        
           | kiicia wrote:
           | its because of markdown formatting
        
         | buddydvd wrote:
         | The part of regex                   [\w\.-_]
         | 
         | should really be                   [\w\.\-_]
         | 
         | instead.
         | 
         | But not that's not what caused the problem mentioned in this
         | post.
         | 
         | (edited for clairifcation)
        
       | jepler wrote:
       | so does "cplusplus"
       | 
       | It seems to have to do with some kind of metadata is fetched and
       | then used as a regular expression (to change markup in some other
       | part of the page?); it's assumed that the text can be used as a
       | regular expression without quotation but in the case of the
       | doubled "+" character it becomes a non-valid RE.
        
       ___________________________________________________________________
       (page generated 2023-09-05 23:02 UTC)