4 ms·
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
by jampa 3y ago
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 https://duckduckgo.com/?q=c%2B%2B&t=ffab&ia=web
- Svip 3y agoCurious that the error does not occur when searching for "Notepad+": https://duckduckgo.com/?q=notepad%2B&t=ffab&atb=v101-1&ia=web https://duckduckgo.com/?q=notepad%2B&t=ffab&atb=v101-1&ia=we...
- jampa 3y agoIn 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 https://en.wikipedia.org/wiki/Notepad%2B" Heading: "Notepad+" ```
- cypherpunks01 3y agoIt's because a single plus '+' is valid in a regex. A double plus '++' is invalid.
- Groxx 3y ago"cpp" seems to work fine though, and returns many results that include "c++"... https://duckduckgo.com/?q=cpp&t=ffab&ia=web https://duckduckgo.com/?q=cpp&t=ffab&ia=web
- deleted 3y ago[deleted]
- SirMaster 3y agoBut "c plus plus" breaks
- chrismorgan 3y agoCorroborating 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=notepad https://html.duckduckgo.com/html/?q=c%2B%2B https://html.duckduckgo.com/html/?q=c%2B%2B https://lite.duckduckgo.com/lite/?q=notepad https://lite.duckduckgo.com/lite/?q=notepad https://lite.duckduckgo.com/lite/?q=c%2B%2B https://lite.duckduckgo.com/lite/?q=c%2B%2B
- cypherpunks01 3y agoIt'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 3y agoSpeaking of control characters breaking things, HN ate the * characters in your post and turned the text into italics instead.
- kiicia 3y agoits because of markdown formatting
- buddydvd 3y agoThe 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)