obsidiantools icon indicating copy to clipboard operation
obsidiantools copied to clipboard

regex improvements (tags)

Open stepsal opened this issue 2 years ago • 0 comments

The current tags_regex is not parsing nested tags for me The proposed regex will also parse all tags from "sussudio.md" example without needing to modify the raw text beforehand. Would be a good improvement to move all the regexes into a constants.py file and load them from there.

Current regex: tags_regex=r'(?<!\()#{1}([A-z]+[0-9_\-]*[A-Z0-9]?)\/?'

Screenshot from 2022-09-13 11-45-21

Proposed Regex: tags_regex=r'(?<!\()(?<!\\)#{1}([A-z]+[0-9_\-]*[A-Z0-9]?[^\s]+(?![^\[\[]*\]\]))\/?'

Screenshot from 2022-09-13 11-34-49

stepsal avatar Sep 13 '22 10:09 stepsal