You could try using matches() instead :
/^[A-Z]{2}$/.matches(file.name)
or, if you want to use the fullname
(the name + extension) of the note, like you did, this seems to work:
/^[A-Z]{2}\.md$/.matches(file.fullname)
You could try using matches() instead :
/^[A-Z]{2}$/.matches(file.name)
or, if you want to use the fullname
(the name + extension) of the note, like you did, this seems to work:
/^[A-Z]{2}\.md$/.matches(file.fullname)