29 Apr 2022 05:47 PM - last edited on 19 Oct 2022 02:37 PM by MaciejNeumann
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 : 100000 (without the '.')
I'm trying to use regex to clean this up, but with no success
For example ([^\.]*+) returns 100 instead of 100000
any suggestions?
thanks!
Patricio
Solved! Go to Solution.
01 May 2022 10:26 AM
In reality, I believe your regex should return a list of two results, 100 and 000
The same will happen with similar regexs, eg. (\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...
08 Aug 2022 06:04 PM
Have you managed to solve this?
I have a similar problem with the comma
08 Aug 2022 07:29 PM
Hey, gabriel_gomez
sadly not yet...
best of luck and if you get the regex, please post it here.
thanks!
Patricio
08 Aug 2022 08:43 PM
This does not have a solution with the regex extraction, since you need to extract two parts (before and after the point).
08 Aug 2022 08:53 PM
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
08 Aug 2022 09:21 PM
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.