- Jun
- 137
- 3
I'm rather weak with regular expressions, so please be gentle if I'm asking a rather simple question. What I want to be able to do is to take a file path of the form C:\WIP\E911\Aurora\branches\3.1_FED\Installer\Analytics.ism and change it to C:\WIP\E911\Aurora\main\Installer\Analytics.ism. The string to search will always be of the form <pre>\branches\<some branch>\<post>, and I want to replace the branches\<some branch> with main. So here's what I tried, and it sure looks right to me:
testit=for %f in (%$) echo %f %@rereplace[branches\\[^\\]+\\,main\\,%@quote[%@full[%f]]]
For the alias, I will supply one or more filenames that may be simple filenames, partial paths (such as dot-relative paths, like ..\test\myfile.txt, or maybe just of the form subdir\myfile.txt), or fully qualified paths. Using the %@quote[%@full[%f]] should cover all three of those cases. But my @rereplace isn't doing anything. My output is just the argument supplied followed by its full path, with no replacement having occurred. What do I have wrong?
testit=for %f in (%$) echo %f %@rereplace[branches\\[^\\]+\\,main\\,%@quote[%@full[%f]]]
For the alias, I will supply one or more filenames that may be simple filenames, partial paths (such as dot-relative paths, like ..\test\myfile.txt, or maybe just of the form subdir\myfile.txt), or fully qualified paths. Using the %@quote[%@full[%f]] should cover all three of those cases. But my @rereplace isn't doing anything. My output is just the argument supplied followed by its full path, with no replacement having occurred. What do I have wrong?