Http and transformationrule

I’m testing a new controller which can report a temperature over http.
The manual query gives me the following result (no xml):

26.8 C

This is the item definition I use:

Number Webtemp “Room Temperature [%.1f °C]” (Temperatures)
{ http="<[]" }

Please advise on the right transformationrule which will extract the actual temperature value.


Number Webtemp "Room Temperature [%.1f °C]" (Temperatures) 
{ http="<[]" }

You can use this JavaScript transform/numonly.js:

(function(num) {
  return num.replace(/[^\d.-]/g,'');

It works, thank you!
I wonder whether it is preferable to REGEX?

I don’t know if REGEX can substitute or only just extract, but whatever is easy and works!

From my perspective this should work as a transformationrule but it doesn’t:


but it works without backslash!