I have set up a Measure site using WebParser.
The site constantly updates by checking the names of users that are connected to it. I have in my RegExp, searches that lead me right up to the actual name which I want to extract as strings. This search is the same before all names, but I do not know how many names will exist at the time of measure. So in RegExp, I have set up the copies of the search many times and then child measures for each stringindex.
I get RegExp matching error (-8). The skin stops working when loaded or refreshed because of this error. How can I make the skin work by ignoring this error since it it telling me that there is nothing to return (in this case, fewer users are connected than the number of Searches/Measures I have set up?)
I just want to be able to capture all instances of user names. Is setting up multiple searches the right way?
Hope I've explained my issue well enough.
It is currently April 20th, 2024, 1:47 pm
WebParser ignore error?
-
- Posts: 13
- Joined: June 7th, 2019, 11:49 pm
-
- Rainmeter Sage
- Posts: 5402
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: WebParser ignore error?
You can use Lookahead Assertion to avoid this error.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 13
- Joined: June 7th, 2019, 11:49 pm
Re: WebParser ignore error?
Thank you!eclectic-tech wrote: ↑June 22nd, 2019, 12:49 pm You can use Lookahead Assertion to avoid this error.
-
- Rainmeter Sage
- Posts: 16148
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: WebParser ignore error?
If you can't get it to work properly, please post the code you have so far. Beside eclectic-tech's suggestion, Lookahead Assertion isn't something really easy to work with.
-
- Posts: 13
- Joined: June 7th, 2019, 11:49 pm
Re: WebParser ignore error?
Here is a portion of the code that I cant seem to manage to get to work properly...
RegExp=(?siU).*<td class="text_left">10.10.(.*)</td>(?(?=.*<td class="text_left">10.).*10.(.*)</td>)
It is searching this text file:
<td class="text_left">1148</td>
<td class="text_left">10.10.60.62 (PPP-UK\actual.user)</td>
<td class="text_right">0</td>
<td class="text_left"></td>
<td class="text_left">User Limit</td>
<td class="text_left">2019-06-10 14:40:44</td>
<td class="text_left">
<td class="text_left">10.10.57.65 (PPP-UK\testing.user)</td>
First string returns 60.62 (PPP-UK\actual.user)
Great.
Then with the lookahead, it is returning 14:40:44
but I want it to return 57.65 (PPP-UK\testing.user)
-
- Rainmeter Sage
- Posts: 5402
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: WebParser ignore error?
"Period" (.) is a special character in Regular Expressions, it is used to specify ANY character.
You should "Escape" (\) any periods so they are seen as actual periods, and not as any character.
This will return your desired string:
You should "Escape" (\) any periods so they are seen as actual periods, and not as any character.
This will return your desired string:
Code: Select all
(?siU).*<td class="text_left">10\.10\.(.*)</td>(?(?=.*<td class="text_left">10\.).*10\.10\.(.*)</td>)
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Rainmeter Sage
- Posts: 16148
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: WebParser ignore error?
Langlu, I meant you to post a COMPLETE code of the skin, not just a RegExp.
-
- Posts: 13
- Joined: June 7th, 2019, 11:49 pm
Re: WebParser ignore error?
Understood. Thanks.eclectic-tech wrote: ↑June 22nd, 2019, 3:30 pm "Period" (.) is a special character in Regular Expressions, it is used to specify ANY character.
You should "Escape" (\) any periods so they are seen as actual periods, and not as any character.
This will return your desired string:Code: Select all
(?siU).*<td class="text_left">10\.10\.(.*)</td>(?(?=.*<td class="text_left">10\.).*10\.10\.(.*)</td>)