I find the current regex usage more like a filtering tool which uses regex to check for if there any matches to the file/folder name (i.e. test with regex),
then replace the whole file/folder name with specified character if any matches.
I think instead of replacing the whole filename, it should have an option (maybe a checkbox) to
only replace the parts of the filename that has matched the regular expression.
Also, another dandy feature of regex is perhaps to allow it to reorder words/matches in folder/file names,
Such as below demonstrated in vbscript code:
- Code: Select all
Set regEx = New RegExp
str = "First Second"
regEx.Pattern = "(\S+)(\s+)(\S+)"
regEx.IgnoreCase = True
str=regex.Replace(str, "$3$2$1")
'$1 correspond to the 1st bracket indicated in the pattern at line 3 - (\S+)
'$2 correspond to the 2nd bracket indicated in the pattern at line 3 - (\s+)
'$3 correspond to the 3rd bracket indicated in the pattern at line 3 - (\S+)
WScript.Echo str
RESULT:
Second First
Note:
To run the above code under windows, copy the code into a newly created text file,
rename the text file to have extension of "vbs", then click on it.
Alternatively, if your not of vbscript background, you can go to this link and see how it demonstrates(and explains) the re-ordering with regex process:
http://regex101.com/r/yH9kL0