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

Inconsistent rules for tag names #1070

Open
gycsaba96 opened this issue Mar 23, 2024 · 0 comments
Open

Inconsistent rules for tag names #1070

gycsaba96 opened this issue Mar 23, 2024 · 0 comments

Comments

@gycsaba96
Copy link
Contributor

There are multiple regular expressions in the source code related to tags. Unfortunately, they have a different idea about valid tag names:

  1. GTG/core/tasks.py: TAG_REGEX = re.compile(r'^\B\@\w+(\-\w+)*\,*')
  2. GTG/gtk/editor/taskview.py: TAG_REGEX = re.compile(r'(?<!\/|\w)\@\w+(\.*[\-\w+\+\%\$\\(\)\[\]\{\}\^\=\/\*])*')
  3. GTG/backends/backend_caldav.py: TAG_REGEX = re.compile(r'\B@\w+[-_()\w]*')

For example, the task editor (2.) recognizes the following lines as tags, but the other two does not:

@r^{2}x(3.14)
@a$(){}
@a^2+b^2=c^2
@_.-._

The first definition is probably the most reasonable and the easiest to handle. However, it might not be that simple based on PR #875.

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