appml / neutrinote

neutriNote - the original extensible Markdown + Math note app. Non-commerical. No lock-ins. Only 3 MB footprint & highly optimized. Designed for plaintext purists.
GNU General Public License v3.0
335 stars 23 forks source link

Regular expressions do not work in the android app's global search #76

Open GfEW opened 2 months ago

GfEW commented 2 months ago

Describe the bug One of the amazing claims that makes Neutrinote stand out is its (purported) regular expression search across all notes. Whilst I find Neutrinote's lean, scalable design, mathjax support and low cognitive load approach very appealing on their own, regular expressions are the single deceicive reason I've gotten started with Neutrinote.

Alas, as of v4.5.1b, Neutrinote's implementation of regular expressions just doesn't seem to be anywhere near usable as advertised. Although it works in single file edit mode, I couldn't find anything beyond glob patterns to works in global search.

Further adding to the confusion, the links named "regular expression" in https://appml.github.io/nano/#search don't even point to https://en.m.wikipedia.org/wiki/Regular_expression but instead to http://en.m.wikipedia.org/wiki/Glob_(programming).

This all begs the question: are regular expressions actually meant to work in Neutrinode's global search, or is that term just a misnomer for "globbing"/"shell patterns"?

To Reproduce Steps to reproduce the behavior:

  1. In an otherwise empty instance of Neutrinote, create three notes with empty bodies and these titles: aaa aaa, abb abb and abc abc. Make sure you remove the .txt suffix that is initially added automatically.
  2. In the notes overview, tap the search button, search for titlereg:ab*abc and see the result.
  3. Tap the search button again, search for titlereg:^a* a*$ and see the result.
  4. Tap the search button again, search for titlereg:b[ bc]+a and see the results.
  5. Tap the search button again, search for titlereg:([abc]+ ?)+ and see the results.

Expected behavior In step 2, there should be no search result. In step 3, there should be exactly one search result, which is aaa aaa. In step 4, there should be exactly two search results, which are abb abb and abc abc. In step 5, there should be exactly three search results, i. e. all three notes should be found.

Actual Behaviour In step 2, there is one (false) result, which is abc abc. In step 3, there are no search results. In step 4, there are no search results. In step 5, there are no search results.

Smartphone (please complete the following information):

Additional information

Syntax questions

Possible solutions