# Does anyone know a cleanup rule that can help get the username out of the title?

**URL:** <https://community.dynatrace.com/t/does-anyone-know-a-cleanup-rule-that-can-help-get-the-username-out-of-the-title/18735>\
**Category:** Real User Monitoring\
**Tags:** real-user-monitoring-classic, user-sessions\
**Created:** [December 6, 2018, 5:08pm UTC](https://community.dynatrace.com/t/does-anyone-know-a-cleanup-rule-that-can-help-get-the-username-out-of-the-title/18735 "2018-12-06T17:08:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam\_sjoerdsma](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/adam_sjoerdsma/32/15312_2.png) [@adam\_sjoerdsma](https://community.dynatrace.com/u/adam_sjoerdsma)\
**Post date:** [December 6, 2018, 5:08pm UTC](https://community.dynatrace.com/t/does-anyone-know-a-cleanup-rule-that-can-help-get-the-username-out-of-the-title/18735/1 "2018-12-06T17:08:11Z")

</div>

Hi team,

I have an application that I am trying to get the usernames out of the \<title\> tag.

I am using the **JavaScript variable** expression type with the “ **docment.title** ” variable. this results in grabbing page titles that have the username at the end.

**Agile Product Lifecycle Management - Welcome , INCDSYPRD01**

**INCDSYPRD01** is an example of the usernames I am trying to grab.

I tried a few different times at getting just the username, but I admit I am not the greatest with Regex.

Does anyone have a cleanup rule that might work at just getting the username?

Thanks,

Adam Sjoerdsma

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [December 6, 2018, 6:37pm UTC](https://community.dynatrace.com/t/does-anyone-know-a-cleanup-rule-that-can-help-get-the-username-out-of-the-title/18735/2 "2018-12-06T18:37:19Z")

</div>

Hi Adam,

If i understand good, you want to find username from page tittle. Please let me know that this username always look the same?

If the username looks like you provided in the example, you can use this regular expression:

_(INC[a-zA-Z0-9]+)_

Radek

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [December 6, 2018, 6:44pm UTC](https://community.dynatrace.com/t/does-anyone-know-a-cleanup-rule-that-can-help-get-the-username-out-of-the-title/18735/3 "2018-12-06T18:44:10Z")

</div>

You can test your expressions here: [https://regex101.com](https://regex101.com)

---

<div class="post-metadata">

**Author:** ![adam\_sjoerdsma](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/adam_sjoerdsma/32/15312_2.png) [@adam\_sjoerdsma](https://community.dynatrace.com/u/adam_sjoerdsma)\
**Post date:** [December 6, 2018, 8:13pm UTC](https://community.dynatrace.com/t/does-anyone-know-a-cleanup-rule-that-can-help-get-the-username-out-of-the-title/18735/4 "2018-12-06T20:13:02Z")

</div>

We actually want to be able and grab any potential username from the statement. From my understanding this will always be one word that can be any combination of characters or numbers.

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [December 6, 2018, 8:26pm UTC](https://community.dynatrace.com/t/does-anyone-know-a-cleanup-rule-that-can-help-get-the-username-out-of-the-title/18735/5 "2018-12-06T20:26:26Z")

</div>

For usernames, there is always a common schema. You must then adjust the regex to find it. If you use the name you gave in the forum, you have a ready-made regular expression above.

---

<div class="post-metadata">

**Author:** ![Radu](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radu/32/23351_2.png) [@Radu](https://community.dynatrace.com/u/Radu)\
**Post date:** [December 7, 2018, 9:54am UTC](https://community.dynatrace.com/t/does-anyone-know-a-cleanup-rule-that-can-help-get-the-username-out-of-the-title/18735/6 "2018-12-07T09:54:36Z")

</div>

Hi Adam,

If you want to catch any possible username, and your title will always follow the convention of **Welcome , \<username\>** at the end of the string, just use:

```auto
Welcome , (.*)$

```
