# regex for cleaning a request attribute

**URL:** <https://community.dynatrace.com/t/regex-for-cleaning-a-request-attribute/35002>\
**Category:** Open Q&A\
**Tags:** regex, request-attributes\
**Created:** [April 29, 2022, 4:47pm UTC](https://community.dynatrace.com/t/regex-for-cleaning-a-request-attribute/35002 "2022-04-29T16:47:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbrown](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pbrown/32/10456_2.png) [@pbrown](https://community.dynatrace.com/u/pbrown)\
**Post date:** [April 29, 2022, 4:47pm UTC](https://community.dynatrace.com/t/regex-for-cleaning-a-request-attribute/35002/1 "2022-04-29T16:47:06Z")

</div>

Hey there,

I’m having trouble extracting a value from a java method for request attribute.

to put it simple:

the value extracted : 100.000

the value we need&nbsp; &nbsp;: 100000&nbsp; (without the ‘.’)

I’m trying to use regex to clean this up, but with no success

For example&nbsp;([^\.]\*+) returns 100 instead of 100000

any suggestions?

thanks!

Patricio

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [May 1, 2022, 9:26am UTC](https://community.dynatrace.com/t/regex-for-cleaning-a-request-attribute/35002/2 "2022-05-01T09:26:54Z")

</div>

[@pbrown](https://community.dynatrace.com/user/21632),

In reality,&nbsp; I believe your regex should return a list of two results, 100 and 000

The same will happen with similar regexs, eg.&nbsp; (\d+)

While it seems pretty easy, I believe it is not, as I have not been able to come up with one that works for all applicable values…

---

<div class="post-metadata">

**Author:** ![gabriel\_gomez](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@gabriel\_gomez](https://community.dynatrace.com/u/gabriel_gomez)\
**Post date:** [August 8, 2022, 5:04pm UTC](https://community.dynatrace.com/t/regex-for-cleaning-a-request-attribute/35002/3 "2022-08-08T17:04:05Z")

</div>

```auto
Have you managed to solve this?
I have a similar problem with the comma

```

---

<div class="post-metadata">

**Author:** ![pbrown](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pbrown/32/10456_2.png) [@pbrown](https://community.dynatrace.com/u/pbrown)\
**Post date:** [August 8, 2022, 6:29pm UTC](https://community.dynatrace.com/t/regex-for-cleaning-a-request-attribute/35002/4 "2022-08-08T18:29:41Z")

</div>

Hey, gabriel\_gomez

sadly not yet…

best of luck and if you get the regex, please post it here.

thanks!

Patricio

---

<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:** [August 8, 2022, 7:43pm UTC](https://community.dynatrace.com/t/regex-for-cleaning-a-request-attribute/35002/5 "2022-08-08T19:43:12Z")

</div>

This does not have a solution with the regex extraction, since you need to extract two parts (before and after the point).

---

<div class="post-metadata">

**Author:** ![gabriel\_gomez](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@gabriel\_gomez](https://community.dynatrace.com/u/gabriel_gomez)\
**Post date:** [August 8, 2022, 7:53pm UTC](https://community.dynatrace.com/t/regex-for-cleaning-a-request-attribute/35002/6 "2022-08-08T19:53:02Z")

</div>

```auto
How can that be solved? I need to remove the comma to be able to add all the fields.The field I have is called totals.
I need to get a report where I can add up all the sales.
583,100
with that format it doesn't let me add, that's why I need to remove the comma

```

---

<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:** [August 8, 2022, 8:21pm UTC](https://community.dynatrace.com/t/regex-for-cleaning-a-request-attribute/35002/7 "2022-08-08T20:21:02Z")

</div>

No, it’s not possible to solve it. You need either two capture groups or do a replacement. None of these is available in request attribute cleanup rules.

Depending on the source of your request attribute, it is possible it can be obtained by other means (without the point/comma character). In general, this cannot be solved using the cleaning rules in Dynatrace.
