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

More ergonomic support for case insensitive keywords #15

Open
dangoodman opened this issue May 4, 2024 · 1 comment
Open

More ergonomic support for case insensitive keywords #15

dangoodman opened this issue May 4, 2024 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@dangoodman
Copy link

It would be great to have a switch to enable a case-insensitive matching of the keywords.

For now, one can use regexes, e.g., "[Tt][Aa][Bb][Ll][Ee]". While it works, it hurts readability a lot if all of the keywords are defined this way.

A new filters.toml key, say "case-insensitive": true/false, could help with that.

Another option is to support regex flags, e.g., "/table/i".

@micl2e2
Copy link
Owner

micl2e2 commented May 4, 2024

Thanks for your rational suggestion!

Since the underlying regex engine used by tg-focus comes from libc's regex.h, there is no support like JS RegExp's flags or Perl RE's modifiers. But REG_ICASE(https://www.man7.org/linux/man-pages/man3/regcomp.3.html) should do the trick. It would be great if someone could send a patch to support such scenarios.

@micl2e2 micl2e2 added enhancement New feature or request help wanted Extra attention is needed labels May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants