# Issue with clean URL regex

**URL:** <https://community.dynatrace.com/t/issue-with-clean-url-regex/20974>\
**Category:** Open Q&A\
**Tags:** regex\
**Created:** [June 13, 2019, 7:57pm UTC](https://community.dynatrace.com/t/issue-with-clean-url-regex/20974 "2019-06-13T19:57:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric\_miles](https://avatars.discourse-cdn.com/v4/letter/e/ecb155/32.png) [@eric\_miles](https://community.dynatrace.com/u/eric_miles)\
**Post date:** [June 13, 2019, 7:57pm UTC](https://community.dynatrace.com/t/issue-with-clean-url-regex/20974/1 "2019-06-13T19:57:51Z")

</div>

I would love some help with getting a clean url working. The RegEx works fine in a regex tester, but when I apply it to a Clean URL setting for a service to a service under Services & Transactions, it doesn’t work at all.

Regex: ([0-9]+\-[1-9])

Samples URLs:

/Leases/Details/111111-1/PaymentHistory

/Leases/Details/222222-1/PaymentHistory

/Leases/Details/111111-1/PaymentSchedule

/Leases/Details/111111-1

/Leases/Details/222222-1

Expectation:

/Leases/Details/[some placeholder]

/Leases/Details/[some placeholder]/PaymentHistory

/Leases/Details/[some placeholder]/PaymentSchedule

---

<div class="post-metadata">

**Author:** ![eric\_miles](https://avatars.discourse-cdn.com/v4/letter/e/ecb155/32.png) [@eric\_miles](https://community.dynatrace.com/u/eric_miles)\
**Post date:** [June 13, 2019, 8:17pm UTC](https://community.dynatrace.com/t/issue-with-clean-url-regex/20974/2 "2019-06-13T20:17:42Z")

</div>

BTW, I got this working in the Application setup, but not for Services & Transactions

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [June 14, 2019, 6:57am UTC](https://community.dynatrace.com/t/issue-with-clean-url-regex/20974/3 "2019-06-14T06:57:53Z")

</div>

To just remove the ID I’d use this cleanup rule:

\d±\d+

But you won’t have any placeholder in this case, the matching part will be removed.

To achieve your desired naming, you have to use naming rule, I’d use placeholders in this case:

 ![20956-screenshot-20190614-085625.png](https://global.discourse-cdn.com/dynatrace/original/2X/5/516ed99d879b1007e7c61134bd71fc32c450bc92.png)

Then the rule would look like this (Placeholder is ### in this case):

 ![20957-screenshot-20190614-085736.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/6/36a9433d3ac8c02c7270a143c48ae08e409cfe5c.png)
