samintz
Scott Mintz
- May
- 1,590
- 27
I have a handful of files that were copied from a "boilerplate" and I want
to rename the files replacing the boilerplate name with my specific
project name.
I want to do something like this:
ren ::NewApp(.*)+ MyProject\1
Where everything after "NewApp" is kept but the "NewApp" text is replaced
with "MyProject". I wanted to use \1 as the first group discovered in the
regex.
NewAppClass.cpp ==> MyProjectClass.cpp
NewAppClass.hpp ==> MyProjectClass.hpp
NewAppInst.cpp ==> MyProjectInst.cpp
NewAppInst.hpp ==> MyProjectInst.hpp
NewAppObj.cpp ==> MyProjectObj.cpp
NewAppObj.hpp ==> MyProjectObj.hpp
While I realize I can do this using delayed expansion:
ren *.[ch]pp "%%@replace[NewApp,MyProject,*]"
I want to know if it's possible using regex.
-Scott
to rename the files replacing the boilerplate name with my specific
project name.
I want to do something like this:
ren ::NewApp(.*)+ MyProject\1
Where everything after "NewApp" is kept but the "NewApp" text is replaced
with "MyProject". I wanted to use \1 as the first group discovered in the
regex.
NewAppClass.cpp ==> MyProjectClass.cpp
NewAppClass.hpp ==> MyProjectClass.hpp
NewAppInst.cpp ==> MyProjectInst.cpp
NewAppInst.hpp ==> MyProjectInst.hpp
NewAppObj.cpp ==> MyProjectObj.cpp
NewAppObj.hpp ==> MyProjectObj.hpp
While I realize I can do this using delayed expansion:
ren *.[ch]pp "%%@replace[NewApp,MyProject,*]"
I want to know if it's possible using regex.
-Scott