cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

regex for cleaning a request attribute

pbrown
Guide

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

6 REPLIES 6

AntonioSousa
DynaMight Guru
DynaMight Guru

@pbrown,

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...

 

Antonio Sousa

gabriel_gomez
Visitor
Have you managed to solve this?
I have a similar problem with the comma

Hey, gabriel_gomez

sadly not yet...

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

thanks!

Patricio

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

Certified Dynatrace Master | TEMPEST a.s., Slovakia, Dynatrace Master Partner

 

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
 


 

 

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.

Certified Dynatrace Master | TEMPEST a.s., Slovakia, Dynatrace Master Partner