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

Feeds & Internet Data • Market Prices

$
0
0
Thanks for trying to guide me ... Really appreciated. I have pasted the xml snip for one stock having extendedMktQuote values, complete xml enclosed between <quickQuote> ... </quickQuote>, to https://regex101.com/r/dU5lQ3/2 (I already did that earlier today).

I "understand" the principal functionality of the branch reset groups but only based on examples which do not exactly fit to my problem. See my "best shot" below, my thinking is that I need .*? twice to ensure these parts can be arbitrary characters? Unfortunately, this RexEx still only gives me the bottom <last> price, and not the one in the <extendedMktQuote> ... </extendedMktQuote> section.

I understand, the branch groups between "|" are prioritized in their order, so obviously there still a bug in my expression. For me this is frustrating, I always try to copy as good as I can from examples, but even with such a "simple task" this fails and all I can do is "play" around with the expression counting on my luck. Just one tiny mistake, the expression fails and I'm left in the dark. That's how it feels. Ok, there's tons of documentation - but it's so dense and cryptic = above my head. :(

Code:

(?siU)^(?|.*?<extendedMktQuote>.*?<last>(.*)<\/last><\/extendedMktQuote>|.*?<last>(.*)<\/last>)
You're very close - I used (no need to abuse the .*? ungreedy toggling in this case):

Code:

(?siU)^(?|.*<extendedMktQuote>.*<last>(.*)<\/last>.*<\/extendedMktQuote>|.*?<last>(.*)<\/last>)
for the test string and it returned the correct stuff:
Last.jpg
Didn't test it in the skin, but then, I don't see why it shouldn't work there as well.

P.S. By the way, the docs are nothing dense and cryptic if you click on the RegExReference button on the left sidebar in the regexr.com page (obviously, after choosing the PCRE flavor from the button at top right) - it's only a short sentence description and a single example for most of the patterns. It's one of the reasons I prefer that site to all the others, it's very clean and straightforward.

Statistics: Posted by Yincognito — Yesterday, 6:03 pm — Replies 252 — Views 8789317



Viewing all articles
Browse latest Browse all 768

Trending Articles