just noting...
regex: (in multi-rename dialog)
from: (.*)sal-...(-\d\d\d.*)
to: (.*)+sal-...(-\d\d\d.*)
is rather (can be rather) slow
(as in, going back, after the fact, & adding the '+',
i thought i actually mis-typed, as i did not see any
change in my New Filenames: (as i should have)
(only to wait a moment, &, oh, there they are)
Multi-Rename, regex: can be slow
Re: Multi-Rename, regex: can be slow
Does it help when you add an 'anchor', like:
^(.*)sal-...(-\d\d\d.*)
or
(.*)sal-...(-\d\d\d.*)$
or even
^(.*)sal-...(-\d\d\d.*)$
^(.*)sal-...(-\d\d\d.*)
or
(.*)sal-...(-\d\d\d.*)$
or even
^(.*)sal-...(-\d\d\d.*)$
Re: Multi-Rename, regex: can be slow
You can speed up almost every regex that uses .* by using .*? instead. That is because .* performs a full-gobble expansion and then backtracks from the end to the beginning again. Your example has two (nested) .* and so it performs this full gobble expansion n-squared times. Most human beings do not intend this behavior when writing their patterns. They expect and anticipate a forward march to reach their intended goal, and usually, it would reach the goal much faster when using a forward march. (.*?)
So use .*? by default and do not use .* if you have any doubts or slowness issues. .* has its intended uses, but they are rare.
And yes, you can't possibly want (.*)+ in this pattern. You certainly mean (.*?) or (.)+?
So use .*? by default and do not use .* if you have any doubts or slowness issues. .* has its intended uses, but they are rare.
And yes, you can't possibly want (.*)+ in this pattern. You certainly mean (.*?) or (.)+?