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

Help: Rainmeter Skins • Lookaround regex for some help

$
0
0
Parsing a weather feed in XML, and have questions on two situations. My best guess is that it involve lookaheads, but although I've read some tutorials, I can't seem to come up with the answers.

First, a section like this:

Code:

<previoussection . . .>   . . .</previoussection><warnings/><nextsection . . .>   . . .</next section>
where a complete <warnings>...</warnings> section may exist, or it may be empty as shown above. The desired behaviour is to have the <warnings> section always captured, even if it is an empty string, in order that the number of captures does not vary.

The second situation is similar, but not identical:

Code:

<winds . . .>   . . .</winds><precipitation . . .>   . . .</precipitation><uv . . .>   . . .</uv . . .>
where the <precipitation> section may exist, or it may be entirely absent, but again, there should still be a capture, even if empty, so that the number of captures remains the same.

Any help or examples appreciated.

Statistics: Posted by qwerky — Today, 8:43 pm — Replies 2 — Views 31



Viewing all articles
Browse latest Browse all 871

Trending Articles