hello.
I cant find here on forum what I need to do from my rainmeter :)
I need that webparser find and display lines with matched strings only...
for example I need display content between <title>(.*)</title> which matching strings in this case words: "Alpha" or "Beta" or "Gamma" (Alpha|Beta|Gamma) (case insesitive)
how to write proper regexp? :) I have only classic simple rss parser like this
Re: webparser regexp display matching strings only
Posted: November 19th, 2017, 10:57 am
by AnimaliX
thanks for info, but this is not it I believe... this not skip "no match" lines I think
well this "IfMatchActions" is something new, so maybe I'm wrong :)
in result I need display only lines 3 and 5 and exclude 1,2,4
Not exactly the best solution, but the Lookahead Assertion could somehow help, I think.
Eg for the above source, you should try the following RegExp: RegExp=(?siU)<title>.*(?(?=Alpha|Beta|Gamma).*(.*))</title>.*<title>.*(?(?=Alpha|Beta|Gamma).*(.*))</title>.*<title>.*(?(?=Alpha|Beta|Gamma).*(.*))</title>.*<title>.*(?(?=Alpha|Beta|Gamma).*(.*))</title>.*<title>.*(?(?=Alpha|Beta|Gamma).*(.*))</title>. The only problem is that the returned string will contain the Alpha, Beta or Gamma words along with the following strings/words, but not those placed before them. For the posted source the third child WebParser measure (which has set StringIndex=3) returns Alpha text, the last one (with StringIndex=5) returns Beta text and the first, the second and the fourth don't return anything (in fact they are returning empty strings). As you can see the text word before the Alpha text and Beta text, is missing.
Is this a problem?
Re: webparser regexp display matching strings only
Posted: November 19th, 2017, 4:22 pm
by FreeRaider
I think I have another solution. It uses a lua script.