# Help with the RegEx for tagging rule

**URL:** <https://community.dynatrace.com/t/help-with-the-regex-for-tagging-rule/32264>\
**Category:** Open Q&A\
**Tags:** regex, tagging\
**Created:** [July 30, 2021, 7:59pm UTC](https://community.dynatrace.com/t/help-with-the-regex-for-tagging-rule/32264 "2021-07-30T19:59:04Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![AK](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ak/32/164_2.png) [@AK](https://community.dynatrace.com/u/AK)\
**Post date:** [July 30, 2021, 7:59pm UTC](https://community.dynatrace.com/t/help-with-the-regex-for-tagging-rule/32264/1 "2021-07-30T19:59:04Z")

</div>

Hi Folks,

I would need some help in defining a tagging rule that can match the set of hosts and assign tag to them.

The hostnames could be like below,

**host1, host2, host3, server1, server2, machine1, machine2**

and the expression I tried was

**host|server|machine** &nbsp;bot it matches only host1 host2 and host3.

Please help me to build RegEx that can match all listed hosts

Regards,

AK

---

_[View the full topic](https://community.dynatrace.com/t/help-with-the-regex-for-tagging-rule/32264)._
