12 Feb 2021 11:57 AM - last edited on 30 Sep 2022 04:01 AM by MaciejNeumann
Hi - I am quite new in the regex area - maybe stupid question...
I would like to convert price from cart - obtained by CSS selector to double (or integer) property.
The format I am getting from HTML is "1 234,56 €". Ideal match is "1234.56" - but I can live also with "1234 ".
Is it even possible to perform via regex in Application - Capturing - Session and user action properties - Custom properties - Apply cleanup rule ??
Currently I am able match either "1" or "234" 😞
Solved! Go to Solution.
I recommend trying out www.regex101.com Your can supply your string and then test regex to parse out the data you are looking for 🙂
You could use something like:
Would not remove the whitespace and keep the " , ".
You could also use this web to test the regex, since DT regex is kinda "limted"? https://22.214.171.124/ anyway. That is something close to test in real time the results.
Thank you Dante,
the DynEx at https://126.96.36.199/ is really great tool - even from learning perspective.
Anyway I was not able to remove space (and was able to remove ",56"). Transformation of result in form "1 234" to double property is leading to DoubleProperty = "null".
Currently I am matching just "234" and using parallel string property. In USQL I an adding then 1000 or 2000 according to "StringProperty" like "1 *" or "2 *". Quite dirty solution 😞
Hopefully in future I will be able to get data from server side as request attribute.
Looks the Dynatrace regex tool is not working now 😞 😞
https://188.8.131.52/ gives ERR_CONNECTION_CLOSED
Do we have any replacement for it ? It was very usefull for me ...