Using regexmatch() in Dataview

Hi Obsidian community.

I have one note per article. Each note contains some properties including “Abstract” which contains text.

What I’m trying to do

I want to use Dataview to create a table of article based on a query. So far, the following query works great.

table Year, Authors, Journal
from "2 - Source Material"
where contains(Abstract, "barrier")
   or contains(file.content, "barrier")
sort Year desc

However, the following using regexmatch() returns an empty table.

table Year, Authors, Journal
from "2 - Source Material"
where regexmatch("barrier", Abstract)
   or regexmatch("barrier", file.content)
sort Year desc

Anyone else run into this?

There is no file.content within a pure Dataview query. So you can’t match against nothing.

To get actual file context you either need to use dataviewjs queries and read the file yourself, or get the text out of file.lists or file.tasks.

Where did you get the idea of using file.content?