# Regex syntax for tagging rules

**URL:** <https://community.dynatrace.com/t/regex-syntax-for-tagging-rules/36651>\
**Category:** Open Q&A\
**Tags:** tagging\
**Created:** [September 26, 2022, 11:25am UTC](https://community.dynatrace.com/t/regex-syntax-for-tagging-rules/36651 "2022-09-26T11:25:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan\_VanBelle](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jan_vanbelle/32/34174_2.png) [@Jan\_VanBelle](https://community.dynatrace.com/u/Jan_VanBelle)\
**Post date:** [September 26, 2022, 11:25am UTC](https://community.dynatrace.com/t/regex-syntax-for-tagging-rules/36651/1 "2022-09-26T11:25:55Z")

</div>

Hello,

We’re trying to adapt the value of an auto-tagging rule.

In order to do so, we’d like to skip the first X characters and then return the remaining part of the string.

(this because Dynatrace does not seem to be able to deal with multiple capturing groups, which was the first attempt)

Current code, working via&nbsp;[regex101: build, test, and debug regex](https://regex101.com/)

^.{7}\K.+

But after all, Dynatrace isn’t able to deal with the ‘\K’ part.

Are there any other solutions?

So, for example: the regex rule applied on

AppPoolTaggingRule

should return

TaggingRule

Thanks for your help,

Jan

---

<div class="post-metadata">

**Author:** ![Jan\_VanBelle](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jan_vanbelle/32/34174_2.png) [@Jan\_VanBelle](https://community.dynatrace.com/u/Jan_VanBelle)\
**Post date:** [September 26, 2022, 11:54am UTC](https://community.dynatrace.com/t/regex-syntax-for-tagging-rules/36651/2 "2022-09-26T11:54:52Z")

</div>

To clarify a little further:

Optional tag value

{ProcessGroup:IISAppPool/^(…)(.\*)\2\w+}

results in error

_The placeholder ‘{ProcessGroup:IISAppPool/^(…)(.\*)\2\w+}’ is invalid: Regex not allowed - Backreferences are not allowed. Please solve this in another way._

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [September 26, 2022, 12:29pm UTC](https://community.dynatrace.com/t/regex-syntax-for-tagging-rules/36651/3 "2022-09-26T12:29:05Z")

</div>

If the name of it starts with App Pool, you could use this

AppPool([^\-]\*+)

Basically its looking for AppPool then grabbing what’s after it.

Should give you a result like this:

 ![ChadTurner_0-1664195547608.png](https://global.discourse-cdn.com/dynatrace/original/2X/4/47fa1f87dd2356d14fc493f57a76603f596345c2.png)

---

<div class="post-metadata">

**Author:** ![Jan\_VanBelle](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jan_vanbelle/32/34174_2.png) [@Jan\_VanBelle](https://community.dynatrace.com/u/Jan_VanBelle)\
**Post date:** [September 26, 2022, 12:47pm UTC](https://community.dynatrace.com/t/regex-syntax-for-tagging-rules/36651/4 "2022-09-26T12:47:41Z")

</div>

Thanks!

That seems to work!

Could you send me the link to the screenshotted page?  
It could’ve spared me a few hours of searching 😉

-- Jan
