Contain match too hungry?

I have notes in markdown that I want to move to a subfolder based on the first (or only) hashtag that they contain.
For example, this is the top of a certain note:
I have created a rule that should match the tag and move it accordingly, using a custom attribute. It more-or-less works, but Hazel seems to either be too eager in matching or not match spaces/newlines at all, as it is matching the custom attribute as "agileBook" (ie. the last part of the tag that I want to match, but also the first word on the next line)
Here you can see the rule and what it matches:
:no_upscale():strip_icc():fill(white):strip_exif()/f/image/bHLqPhYfMhk35qQfe2Fk1sSU.jpg?f=user_large)
A closer look at the "resource" custom attribute, which contains only characters. According to the hover text, it should only match non-blank characters:
:no_upscale():strip_icc():fill(white):strip_exif()/f/image/6I4FYtUbOEXAlerSE2dB8LvV.jpg?f=user_large)
And this is a closer look at the content Hazel seems to read:
:no_upscale():strip_icc():fill(white):strip_exif()/f/image/k6uRgB4er4nSJuRMPZYIsWgE.jpg?f=user_large)
Am I missing something here? Is Hazel not reading my file correctly, is there something wrong with my matching pattern, or is Hazel just too hungry in matching?
I've tried adding a space at the end of my matching pattern, but that doesn't seem to have any effect
For example, this is the top of a certain note:
author:: Trev de Vroome
source:: [Book Summary: Accelerate](https://tdevroome.medium.com/book-summa ... 31efe4c34c)
clipped:: [[2022-05-23]]
published:: 2019-10-18
#resources/agile
# Book Summary: Accelerate

Accelerate, by Nicole Forsgren PhD, Jez Humble, and Gene Kim
I have created a rule that should match the tag and move it accordingly, using a custom attribute. It more-or-less works, but Hazel seems to either be too eager in matching or not match spaces/newlines at all, as it is matching the custom attribute as "agileBook" (ie. the last part of the tag that I want to match, but also the first word on the next line)

Here you can see the rule and what it matches:
:no_upscale():strip_icc():fill(white):strip_exif()/f/image/bHLqPhYfMhk35qQfe2Fk1sSU.jpg?f=user_large)
A closer look at the "resource" custom attribute, which contains only characters. According to the hover text, it should only match non-blank characters:
:no_upscale():strip_icc():fill(white):strip_exif()/f/image/6I4FYtUbOEXAlerSE2dB8LvV.jpg?f=user_large)
And this is a closer look at the content Hazel seems to read:
:no_upscale():strip_icc():fill(white):strip_exif()/f/image/k6uRgB4er4nSJuRMPZYIsWgE.jpg?f=user_large)
Am I missing something here? Is Hazel not reading my file correctly, is there something wrong with my matching pattern, or is Hazel just too hungry in matching?
I've tried adding a space at the end of my matching pattern, but that doesn't seem to have any effect
