It is currently April 25th, 2024, 7:48 am

Recursion in Rainmeter's regexes

General topics related to Rainmeter.
User avatar
Yincognito
Rainmeter Sage
Posts: 7157
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Recursion in Rainmeter's regexes

Post by Yincognito »

Any idea why doesn't recursion ((?R)) work in tools like RainRegExp (therefore, probably not in Rainmeter proper either, say in a RegExp option of a WebParser parent measure)? Is it a PCRE version thing, a resource based limitation, or just a misunderstanding from my part? If it's supposed not to work, then are there any plans to make it available in the future by any chance?

The other day I was trying to capture some stuff from the weather.com JSON part while balancing (nesting) paranthesis. I got the method from SO, tested it in both regex101.com and regexr.com and it worked, but not in RainRegExp. I've since overcome the hurdle by using additional anchors in the regex pattern, but capturing an entire paranthesis enclosed part from a string like {a:{b,c,d:{e,f},g}},h would be less prone to potential changes in the anchor location/presence that might happen while using the current method (though on the flip side, a recursion based regex is longer and harder to build)...

P.S. Yes, I know: regex isn't the right tool for such tasks. I don't care about this though, since it is nevertheless possible.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth