# Web Request Naming - Placeholder using regex

**URL:** <https://community.dynatrace.com/t/web-request-naming-placeholder-using-regex/32026>\
**Category:** Open Q&A\
**Tags:** regex, request-attributes\
**Created:** [July 7, 2021, 10:14am UTC](https://community.dynatrace.com/t/web-request-naming-placeholder-using-regex/32026 "2021-07-07T10:14:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![phalgun](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@phalgun](https://community.dynatrace.com/u/phalgun)\
**Post date:** [July 7, 2021, 10:14am UTC](https://community.dynatrace.com/t/web-request-naming-placeholder-using-regex/32026/1 "2021-07-07T10:14:33Z")

</div>

Hi

I am trying to name web requests using Placeholder. I have two web requests variations that must be named in the same format. How do I achieve this? I tried the regex way but I am not able to make it possessive as lookbacks and lookaheads are not allowed in DT. OR is there a non-regex solution?

Original Web Requests

1. URL Path is&nbsp;/folder1/ws?serviceName=aBcD&methodName=xYz

2. URL Path is&nbsp;/folder1/ws?methodName=xYz&serviceName=aBcD

I need both of them to be renamed as ‘Web Service - xYz’.

My solution was this:

Condition - URL Query contains ‘methodName=’

Placeholder - variable called MName, using URL Query, Regex extraction, regex string is&nbsp;_methodName=([a-zA-Z]+)_. unfortunately this is greedy, so DT does not allow this. I need to ‘match’ the methodName= string, but it should not be in the result.

I cant use the before/after/between delimiter here since the position of the methodName changes.

---

<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:** [July 7, 2021, 12:36pm UTC](https://community.dynatrace.com/t/web-request-naming-placeholder-using-regex/32026/2 "2021-07-07T12:36:56Z")

</div>

What if you add in the \* for a value of&nbsp;methodName=([a-zA-Z]\*+)

 ![ChadTurner_0-1625661399996.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/d/8d6a9e146ecee36a9f1b2e7d87d80663577c2b1b.png)

---

<div class="post-metadata">

**Author:** ![phalgun](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@phalgun](https://community.dynatrace.com/u/phalgun)\
**Post date:** [July 7, 2021, 2:11pm UTC](https://community.dynatrace.com/t/web-request-naming-placeholder-using-regex/32026/3 "2021-07-07T14:11:29Z")

</div>

Nice! that works! I was under the impression that both . and \* are greedy and hence not allowed by DT. glad that \* works.

---

<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:** [July 7, 2021, 2:15pm UTC](https://community.dynatrace.com/t/web-request-naming-placeholder-using-regex/32026/4 "2021-07-07T14:15:13Z")

</div>

[@phalgun](https://community.dynatrace.com/user/10059)&nbsp;I ran into the same issue with greedy quantifiers as well and kept looking and looking for a solution around the “+” I was extremely happy when I found that we could add the “\*” to the + in order to negate the greedy classification&nbsp;:dancing\_blob::party_blob::party_cat:

---

<div class="post-metadata">

**Author:** ![AbAmani](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@AbAmani](https://community.dynatrace.com/u/AbAmani)\
**Post date:** [July 7, 2021, 2:23pm UTC](https://community.dynatrace.com/t/web-request-naming-placeholder-using-regex/32026/5 "2021-07-07T14:23:05Z")

</div>

Thanks Chad! That worked for me too&nbsp;:dancing\_penguin:.

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [July 7, 2021, 2:50pm UTC](https://community.dynatrace.com/t/web-request-naming-placeholder-using-regex/32026/6 "2021-07-07T14:50:38Z")

</div>

You might want to try lookaround matches like this:

```markup
(?<=methodName=)[aA-zZ]*(?=\&)

```
