Make Regex Pattern for matching emoji match signifiers anywhere in the line #404
Replies: 2 comments 1 reply
-
The reason is to avoid false positives. Maybe someone uses an emoji and a date in the task's description. We wouldn't want to match that. For that reason, when parsing a task, we keep matching (and removing) from the end of the line until we don't find any more matches. Also: it would be much harder to serialize tasks if the date can be anywhere. The user would expect the date to stay in place when, for example, toggling a task's status. At the moment, we simply append all metadata after the description, which is very easy to do. |
Beta Was this translation helpful? Give feedback.
-
I changed the title of this from: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Looking at the way the match happens on the task the reg ex epects the match to always be at the end of the line by having
$
on the end. Is there a reason for this?If we have say
[📅📆🗓] ?(\d{4}-\d{2}-\d{2})
and not[📅📆🗓] ?(\d{4}-\d{2}-\d{2})$
then the date can be anywhere in the string. The replace should also still work in this case. I tested it out in the code with the following jest test and worked fine.This had a modification to the Tasks object and removes the
$
from the regex for due and done.Beta Was this translation helpful? Give feedback.
All reactions