Suppose I have a string like:
jsmorley is a smart guy (see what I just did here?
) in a measure, and I want to replace every letter with its alphabetical index (e.g. a->1, b->2 and so on), I would do like this:
Code: Select all
RegExpSubstitute=1
Substitute="a":"1","b":"2",...and so forth
...but this is running through the string 26 times (once for every letter in the alphabet) just to replace a single letter globally (in this case), which might be overkill from a performance point of view if you have to do a lot of (different) replacements. Is there a way to do this in a single regex pass through the whole string? That is, running through the string a single time, and replace letters as the regex advances through the string. Like I think it seems to be done
here, in the first piece of code (this is in Python, not in C++ though).
In other words, is there a way to "concatenate" or "join" multiple regex substitutions in a single big regex substitution that achieves the same result? If not, is this an easy to implement thing in a potentially new option in Rainmeter measures?