# Substring of a placeholder

**URL:** <https://community.dynatrace.com/t/substring-of-a-placeholder/35668>\
**Category:** Open Q&A\
**Tags:** tagging, naming-rules\
**Created:** [June 29, 2022, 12:31pm UTC](https://community.dynatrace.com/t/substring-of-a-placeholder/35668 "2022-06-29T12:31:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlos\_ortega](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@carlos\_ortega](https://community.dynatrace.com/u/carlos_ortega)\
**Post date:** [June 29, 2022, 12:31pm UTC](https://community.dynatrace.com/t/substring-of-a-placeholder/35668/1 "2022-06-29T12:31:29Z")

</div>

Hi,

At this moment, Dynatrace is recognizing some variables and they are saved as placeholders to be used at tag rules or request naming rules. However, I would like to know how we can get a part of the value.

for example, i have the following variable:

DockerStrippedname=docker/microservice

I would like to get the value of “microservice” as the content of the placeholder to be used in the rule. I don’t know if it could be possible to add a expresion into the placeholder definition {ProcessGroup:dockerstrippedname} to get only this part.

is it possible?

thanks,

Carlos

---

<div class="post-metadata">

**Author:** ![AlexOsbourn](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@AlexOsbourn](https://community.dynatrace.com/u/AlexOsbourn)\
**Post date:** [June 30, 2022, 3:15pm UTC](https://community.dynatrace.com/t/substring-of-a-placeholder/35668/2 "2022-06-30T15:15:11Z")

</div>

When using placeholders, if you specify a forward slash (/) before the closing curly-bracket, you can use regex immediately after it. For example:

If your value is&nbsp;&nbsp; **DockerStrippedname=docker/microservice** and you want to capture everything after the&nbsp; **=** , you would enter your placeholder like:

**{ProcessGroup:dockerstrippedname/^[^=]\*=(.\*?$)}**

(I’m not too great at regex so there is probably a better way to do that).

---

<div class="post-metadata">

**Author:** ![techean](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/techean/32/227_2.png) [@techean](https://community.dynatrace.com/u/techean)\
**Post date:** [June 30, 2022, 4:56pm UTC](https://community.dynatrace.com/t/substring-of-a-placeholder/35668/3 "2022-06-30T16:56:24Z")

</div>

Try something like, works !

Tag:

```auto
{ProcessGroup:dockerstrippedname/^(.*?)_}

```

Condition:

```auto
^.*?_

```

---

<div class="post-metadata">

**Author:** ![carlos\_ortega](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@carlos\_ortega](https://community.dynatrace.com/u/carlos_ortega)\
**Post date:** [July 1, 2022, 6:17am UTC](https://community.dynatrace.com/t/substring-of-a-placeholder/35668/4 "2022-07-01T06:17:23Z")

</div>

Hi,

Thanks a lot!, the following expresion gives me the solution:

/.+\/([^\/]\*+)

thanks!

---

<div class="post-metadata">

**Author:** ![techean](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/techean/32/227_2.png) [@techean](https://community.dynatrace.com/u/techean)\
**Post date:** [July 1, 2022, 10:12am UTC](https://community.dynatrace.com/t/substring-of-a-placeholder/35668/5 "2022-07-01T10:12:13Z")

</div>

Good&nbsp;&nbsp;👍!
