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

Custom rule with regex boundary does not work #564

Closed
wdjunaidi opened this issue Sep 15, 2024 · 1 comment
Closed

Custom rule with regex boundary does not work #564

wdjunaidi opened this issue Sep 15, 2024 · 1 comment

Comments

@wdjunaidi
Copy link

Describe the bug
Custom rule for matching note title with boundary doesn't apply the icon. The custom rule is ^\d{4}-\d{2}-\d{2}$, where it should matches note with that exact format only.

When I try without boundary, e.g. \d{4}-\d{2}\-d{2}, the icon is shown on the notes but it also shown for other notes that have that format in them, such as Screenshot 2024-09-01 at 11:00:00.png

To Reproduce
Steps to reproduce the behavior:

  1. Have 2 notes with 2 the following titles 2024-09-01 and Screenshot 2024-09-01
  2. Create custom icon rule with ^\d{4}-\d{2}-\d{2}$ rule and pick an icon
  3. The icon does not show

Expected behavior
The icon is shown for 2024-09-01 note only, and not shown for Screenshot 2024-09-01.

@wdjunaidi
Copy link
Author

Found the solution, I should use word boundary instead of string boundary.

Using the following regex works: \b\d{4}-\d{2}-\d{2}(?:\.\w+)?\b

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