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

Help: Rainmeter Skins • Re: Leading Zeros

$
0
0
I thought I could help with the regular expression by combining some steps all into the same expression:

Code:

Substitute="^(-?)(\d+)\.?(\d+)?":"+\1000\2.\3000","\\1|\\3":"",".*([-+]).*(\d{3}\.\d{2}).*":"\1\2"
But I found that zero length matches, instead of returning an empty string "", instead do not substitute.
So I had to add an additional, in my opinion unnecessary, expression to remove them:

Code:

"\\1|\\3":""

So my code ended up being just as complicated as what I was trying to replace...
I am assuming there is a reason for this design decision? It seems to go contrary to the RegEx rules...

https://docs.rainmeter.net/manual/measures/general-options/substitute/#RegExpSubstitute

1.jpg

Statistics: Posted by jsmorley — Today, 8:47 pm



Viewing all articles
Browse latest Browse all 1134

Trending Articles