It is currently December 3rd, 2020, 11:12 am

Skripting BUG . RegExpTester vs Real

Help with creating, editing & fixing problems with skins
VolkerGr
Posts: 4
Joined: November 8th, 2020, 5:18 pm

Skripting BUG . RegExpTester vs Real

Post by VolkerGr »

And help is welcome.
Reg Expression works in RegExpTester. But not in "Real" Skript as follow
Thanx

Code: Select all

[Rainmeter]
Update=5000
AccurateText=1
DynamicWindowSize=1

[MeasureSite]
Measure=WebParser
URL=https://www.lgl.bayern.de/gesundheit/infektionsschutz/infektionskrankheiten_a_z/coronavirus/karte_coronavirus/
RegExp=(?siU)<tr>.*<td>Würzburg</td>.*<td>(.*)</td>.*<td>(.*)</td>.*<td>(.*)</td>.*<td>(.*)</td>.*<td>(.*)</td>.*<td>(.*)</td>.*<td>(.*)</td>


[MeterDummy]
Meter=String

[MeasureValue]
Measure=WebParser
URL=[MeasureSite]
StringIndex=1
Last edited by balala on November 8th, 2020, 5:39 pm, edited 1 time in total.
Reason: Please use [code] tags whenever are you posting code snippets. It's the </> button.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4206
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Skripting BUG . RegExpTester vs Real

Post by eclectic-tech »

The RegExp "works" but it takes 5 seconds to show the results due to the skin update set to 5000ms.
The RegExp captures "spaces", "line feeds", and "carriage returns" ... this can be eliminated for the "Würzburg" results by using:
RegExp=(?siU)<tr>.*<td>Würzburg</td>.*<td>.*\r\n\s++(.*)</td>.*<td>.*\r\n\s++(.*)</td>.*<td>(.*)</td>.*<td>(.*)</td>.*<td>(.*)</td>.*<td>.*\r\n\s++(.*)</td>.*<td>.*\r\n\s++(.*)</td>

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[MeasureSite]
Measure=WebParser
URL=https://www.lgl.bayern.de/gesundheit/infektionsschutz/infektionskrankheiten_a_z/coronavirus/karte_coronavirus/
RegExp=(?siU)(?siU)<tr>.*<td>Würzburg</td>.*<td>.*\r\n\s++(.*)</td>.*<td>.*\r\n\s++(.*)</td>.*<td>(.*)</td>.*<td>(.*)</td>.*<td>(.*)</td>.*<td>.*\r\n\s++(.*)</td>.*<td>.*\r\n\s++(.*)</td>

[MeasureValue1]
Measure=WebParser
URL=[MeasureSite]
StringIndex=1

[MeasureValue2]
Measure=WebParser
URL=[MeasureSite]
StringIndex=2

[MeasureValue3]
Measure=WebParser
URL=[MeasureSite]
StringIndex=3

[MeasureValue4]
Measure=WebParser
URL=[MeasureSite]
StringIndex=4

[MeasureValue5]
Measure=WebParser
URL=[MeasureSite]
StringIndex=5

[MeasureValue6]
Measure=WebParser
URL=[MeasureSite]
StringIndex=6

[MeasureValue7]
Measure=WebParser
URL=[MeasureSite]
StringIndex=7

[MeterValue1]
Meter=String
MeasureName=MeasureValue1
FontSize=24
FontColor=255,255,255

[MeterValue2]
Meter=String
MeasureName=MeasureValue2
X=r
Y=R
FontSize=24
FontColor=255,255,255

[MeterValue3]
Meter=String
MeasureName=MeasureValue3
X=r
Y=R
FontSize=24
FontColor=255,255,255

[MeterValue4]
Meter=String
MeasureName=MeasureValue4
X=r
Y=R
FontSize=24
FontColor=255,255,255

[MeterValue5]
Meter=String
MeasureName=MeasureValue5
X=r
Y=R
FontSize=24
FontColor=255,255,255

[MeterValue6]
Meter=String
MeasureName=MeasureValue6
X=r
Y=R
FontSize=24
FontColor=255,255,255

[MeterValue7]
Meter=String
MeasureName=MeasureValue7
X=r
Y=R
FontSize=24
FontColor=255,255,255

wurtzberg.png
You do not have the required permissions to view the files attached to this post.
VolkerGr
Posts: 4
Joined: November 8th, 2020, 5:18 pm

Re: Skripting BUG . RegExpTester vs Real

Post by VolkerGr »

Thanks alot,
Still getting used to the syntax of RegExpression. I can read them perfect,but creating my own twists my head :)
Even i am a computer sience engineer ;) But i appreciate your help
Regards ;)
VolkerGr
Posts: 4
Joined: November 8th, 2020, 5:18 pm

Re: Skripting BUG . RegExpTester vs Real

Post by VolkerGr »

Interresting,
I still runs into a
RegExp matching error (-1) (Test\Test.ini - [MeasureSite])
I exactly parsed your script.
In RegExTester still works. This is weired
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4206
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Skripting BUG . RegExpTester vs Real

Post by eclectic-tech »

VolkerGr wrote: November 9th, 2020, 12:17 pm Interresting,
I still runs into a
RegExp matching error (-1) (Test\Test.ini - [MeasureSite])
I exactly parsed your script.
In RegExTester still works. This is weired
You have this file encoded as UTF-8 which will not work properly; change the encoding to USC-2 LE BOM.
(See: This Tip)
JSMorley wrote:I strongly suggest that ALL Rainmeter skin .ini files be encoded as UTF-16 LIttle Endian. This will allow you to use any of the characters from the ASCII / Extended ASCII set, as well as any Unicode characters. Unicode of course has the additional imitation that the font you are using in the skin must support the character(s), but most decent fonts support a wide range of Unicode characters. This is one of those situations where doing it this way can never hurt, but not doing it can lead to confusion and problems. Just get in the habit. Note that the new "Create new skin" functionality in Rainmeter's Manage dialog will always create new .ini files as UTF-16 Little Endian.

The encoding you want in different text editors:

Unicode (Windows Notepad.exe)
UCS-2 LE BOM (Notepad++)
UTF-16 LE (Sublime Text)
Because you have the skin Update=10000 after 10 seconds you will see the results of the refreshed skin.
VolkerGr
Posts: 4
Joined: November 8th, 2020, 5:18 pm

Re: Skripting BUG . RegExpTester vs Real

Post by VolkerGr »

Yeap,
i had the same idea during coffee time.
The german "Umlaut" W"ü"rz is crashing the parser
Thanks again for your help
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4206
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Skripting BUG . RegExpTester vs Real

Post by eclectic-tech »

Happy to help :thumbup: