Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GfEW opened this issue Apr 28, 2024 · 0 comments
Open

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

GfEW opened this issue Apr 28, 2024 · 0 comments

Comments

@GfEW
Copy link

GfEW commented Apr 28, 2024

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):

  • various Android 9 to Android 11 devices
  • Neutrinote CE v4.5.1b

Additional information

Syntax questions

  • I couldn't find any information about quoting syntax that might be required to protect search terms containing e. g. spaces or commas. Perhaps such search terms should be wrapped in single or double quotes? I have tried all variants I could think of, to no avail.
  • Depending on the regex flavour, unprotected special or meta characters within the regex could need to be escaped with a backslash, like in titlereg:^a*\ a*$ (escaped space) in step 3 or titlereg:\([abc]+\ ?\)+ (escaped grouping parentheses) in step 5. I have tested both, to no avail.

Possible solutions

  • The most disirable and useful solution to this would obviously be fully functional regular expressions!
  • Optionally, the current '.*reg:' search field operators could be simply renamed to titleglob: etc. and be kept along with then proper titlereg: etc., to keep existing filters working after a low-effort adaptation.
  • Only in the (unfortunate) case that regular expressions are not meant to be usable in Neutrinote, the documentation should refrain from making that promise, and the search field operators should be clear about what they actually do: e. g. instead of the misleading 'titlereg:', something like titleglob: would be adequate.
@GfEW GfEW changed the title Regular expressions do not work in the android app Regular expressions do not work in the android app's global search May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant