Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1575

Help: Rainmeter Skins • Re: Help me : Want to display data only match with system date

$
0
0
But when i increase the number of lines in text file it stopped working, sometimes it shows regex matching error -08 in log and sometime no error but display nothing in meter. Is rainmeter have any restriction related to text lines or text file size?
Alright, tested the code and indeed it throws that error. Apparently, the lookahead assertions in the Item variable have to test too many possible occurrences in your file, something one can see if testing the file contents and the regex on testing grounds like the RegExR.com or regex101.com sites, where similar errors occur. So yeah, it looks like such a limitation has been reached in your case.

The solution is simple in terms of changes, but it involves a less known regex group named the branch reset group. So, avoiding using the lookahead assertion and using the branch reset group (without actually capturing anything in the 2nd brach, in order to "skip" past unmatched instances) in the Item variable from [Variables] should solve the issue:

Code:

Item=(?|.*(<01>[mTime]<\/01>.*)\R|.*)
To be on the safe side and be able to test it on online sites as well, you could also add a ^ before the #Item# list in the RegExp option from your mBook measure. Things seem to work in Rainmeter without this detail, but on the online regex sites you'll get errors like "catastrophic backtracking" if you don't "anchor" the pattern to the beginning of the string (represented by the aforementioned ^ symbol).

Reference: https://www.regular-expressions.info/branchreset.html

Statistics: Posted by Yincognito — Yesterday, 10:49 pm



Viewing all articles
Browse latest Browse all 1575

Trending Articles