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

Feeds & Internet Data • Re: Market Prices

$
0
0
Damn - I really tried to find such an explanation but e.g. regexr.com gives this explanation:

. Dot. Matches any character except line breaks.
* Quantifier. Match 0 or more of the preceding token.
? Lazy. Makes the preceding quantifier lazy, causing it to match as few characters as possible.
The same regexr.com also says on the last line:
This behaviour is reversed by the ungreedy (U) flag/modifier.
which is the case here, see the beginning of the pattern.

In other words, the (?U) ungreedy flag at the start (which already makes the pattern lazy and match as few characters as possible) makes the ? mean the opposite to the "standard" behavior (so .*? will be greedy and match as many characters as possible in this case). This is supported by the entry for Flags > U, which says:
Makes quantifiers ungreedy (lazy) by default. Quantifiers followed by ? will become greedy.
Technically, the .*? locally inverted the (standard greedy behavior) overall inversion by (?U) at the start, if it makes sense. :D
Default greedy overall (i.e. for the whole pattern). Inverted to lazy overall by (?U). Then inverted back to greedy locally by the ? (just for the .* part).

Statistics: Posted by Yincognito — Yesterday, 8:52 pm



Viewing all articles
Browse latest Browse all 1579

Trending Articles