It is currently September 18th, 2019, 12:11 am

RegExp Question

Help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 19457
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RegExp Question

jsmorley » August 28th, 2019, 4:34 pm

gkmaz9 wrote:
August 28th, 2019, 4:31 pm
The quantity of 01 changes freely.
It can be 0 or 3 or 100.

So... at first, I set RegExp between 01 and 02.

However, there are times when 03 or 04 comes instead of 02(in regular order).
Also, there are times when there are only 01.
Well, that means that you have to create a RegExp for the WebParser parent measure that is looking for 100 possible matches on 01:, using the lookahead assertion approach to be sure it doesn't fail if there are less than 100. Then you need 100 WebParser child measures to get the individual values, and 100 meters to display the results. You can have it "hide" the meters you don't need, but they have to exist.

To be perfectly honest, this might not be the best candidate for Rainmeter.
gkmaz9
Posts: 20
Joined: August 26th, 2019, 10:42 am

Re: RegExp Question

gkmaz9 » August 28th, 2019, 4:56 pm

Is there anything to find 'Enter'?

RegExp=(?siU)01: (.*)(meaning of 'Enter')
l
The command I'm looking for.

is it "\r\n"?
-----------------------------------------------------
I'd like to get from the first line containing 01: to the last line containing 01:.

If you don't have the right command, what about this?

This is how I thought.

Extract each line.
First line with 01:
Second line with 01:
.
.
Last line with 01:

And put them all together.
-------------------------------------------------------

Knowing some command will give me a new try.
Extracting the first line with 01:
Extracting a second line with 01:
.
.
A conclusion is
Extract at 01: until the next line.
gkmaz9
Posts: 20
Joined: August 26th, 2019, 10:42 am

Re: RegExp Question

gkmaz9 » August 28th, 2019, 5:23 pm

Thank you very much for your answer.

The first thing you told me was right.
I applied it.

Code: Select all

[1hour1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=file://C:\Users\USER\Documents\Rainmeter\Skins\Tree\@Resources\Log\190824.inc
RegExp=(?siU)01: (.*)\r\n.*
StringIndex=1
Substitute="01: ":"","#XX#"

[1hour2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=file://C:\Users\USER\Documents\Rainmeter\Skins\Tree\@Resources\Log\190824.inc
RegExp=(?siU)01: (.*)\r\n.*01: (.*)\r\n.*
StringIndex=2
Substitute="01: ":"","#XX#"

[1hour3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=file://C:\Users\USER\Documents\Rainmeter\Skins\Tree\@Resources\Log\190824.inc
RegExp=(?siU)01: (.*)\r\n.*01: (.*)\r\n.*01: (.*)\r\n.*
StringIndex=3
Substitute="01: ":"","#XX#"

[1hour4]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=file://C:\Users\USER\Documents\Rainmeter\Skins\Tree\@Resources\Log\190824.inc
RegExp=(?siU)01: (.*)\r\n.*01: (.*)\r\n.*01: (.*)\r\n.*01: (.*)\r\n.*
StringIndex=4
Substitute="01: ":"","#XX#"

[OutPut1]
meter=String
MeasureName=1hour1
MeasureName2=1hour2
MeasureName3=1hour3
MeasureName4=1hour4
FontSize=#XXSize#
FontColor=#XXFontColor#
SolidColor=#XXWhite#
DynamicVariables = 1 
Text=%1#CRLF#%2#CRLF#%3#CRLF#%4
X=#XXX#
Y=50
W=400
User avatar
jsmorley
Developer
Posts: 19457
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RegExp Question

jsmorley » August 28th, 2019, 6:00 pm

Great. Glad you got it working...
gkmaz9
Posts: 20
Joined: August 26th, 2019, 10:42 am

Re: RegExp Question

gkmaz9 » August 28th, 2019, 6:11 pm

new 'simple and difficult' problem has been discovered.
If it is fixed, it's really over. :Whistle