Hello everyone. I have been trying to create my own weather skin, but I need a substitute rule I am not sure how to address or where to put it since it is not working in either the Weather measure or the string meter.
[Tiempo]
Measure=WebParser
URL=[PaginaWeb]
StringIndex=3
;This is the temperature I need, comes in the format "17°C", I need only the number 17...
;The substitute I need to use, but unsure where to put it...
RegExpSubstitute=1
Substitute="^(\d{2})(.*)":"\1"
[Cadena]
Meter=String
MeasureName=?
AntiAlias=1
Substitute always belongs to a measure, never to a meter (docu)
Your substitution is correct, but only for positive, 2-digit temperatures (from 10 to 99 degrees ; the \d{2} means "exactly 2 digits").
if you want negative temperatures as well, which would come, let's say, with an optional minus-sign, the regex should be:
what would be the best way to separate content of a StringIndex such as 7 of 10?
The two numbers are necessary (as integers ofc), while the text between isn't. The text is not fixed.
Pul53dr1v3r wrote: ↑October 17th, 2019, 5:28 pm
what would be the best way to separate content of a StringIndex such as 7 of 10.
The two numbers are necessary (as integers ofc), while the text between isn't. The text is not fixed.
A regular expression substitution. For instance supposing that a following kind of measure is returning the 7 of 10 string, add the following two measures:
As I hope you've figured it out, [MeasureNumber1] is returning the first number (that before of), while [MeasureNumber2] obviously is returning the other number (placed after of).
balala wrote: ↑October 17th, 2019, 5:40 pm
A regular expression substitution. For instance supposing that a following kind of measure is returning the 7 of 10 string, add the following two measures:
As I hope you've figured it out, [MeasureNumber1] is returning the first number (that before of), while [MeasureNumber2] obviously is returning the other number (placed after of).
I was close, but forgot to put RegExpSubstitute into the measure.
Thanks!