Run multiple regex operations after each other
See original GitHub issueI’m using Obsidian to collect notes on history-related topics and I tag each event with its corresponding year in the following format: #year/1942
Now I’m trying to build a table in dataview that shows me all notes for events from the 20th century. This is what the statement looks like:
TABLE WITHOUT ID
file.link AS Event,
regexreplace(file.etags, "#year/", "") AS Year
WHERE contains(tags, "year/19")
sort regexreplace(file.etags, "year", "") ASC
The problem is this line in my query: regexreplace(file.etags, "#year/", "") AS Year
. Using that query, I am able to cut off the first part of the tag to just show the year itself and not the full tag, which is exactly what I want.
But this line also shows all other tags from the corresponding note. Therefore, I’d like to add another regex operation for that same table column so that I just see the year and nothing else - especially no other tags.
Is this implemented already or am I missing something obvious here?
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (9 by maintainers)
Top GitHub Comments
I’ve added
filter
documentation to to the function documentation here: https://blacksmithgu.github.io/obsidian-dataview/query/functions/#objects-arrays-and-string-operations.You can try parsing the date and then extracting the fields you want via a
dateformat
-