# Non-greedy match

**URL:** <https://discourse.beets.io/t/non-greedy-match/894>\
**Category:** Help\
**Created:** [August 25, 2019, 10:52pm UTC](https://discourse.beets.io/t/non-greedy-match/894 "2019-08-25T22:52:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![beetz](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/beetz/32/280_2.png) [@beetz](https://discourse.beets.io/u/beetz)\
**Post date:** [August 25, 2019, 10:52pm UTC](https://discourse.beets.io/t/non-greedy-match/894/1 "2019-08-25T22:52:50Z")

</div>

How do I prevent `beet mod -a genre:Pop` from matching “Rock.Pop” genre tags and limit the matches to “Pop” proper?

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [August 26, 2019, 1:55am UTC](https://discourse.beets.io/t/non-greedy-match/894/2 "2019-08-26T01:55:32Z")

</div>

Try a regular expression query! Then you can use ^ and $ to ensure you’re matching the whole string.
