
mlr --csvlite rename -r ^Date_[0-9].*$,Date ./reg-test/input/date1.csv ./reg-test/input/date2.csv
Name,Date,Extraneous
Alice,2015-05-14,foo
Bob,2015-05-11,bar
Chuck,2015-05-28,quux
Denise,2015-05-02,meep
Alice,2015-06-23,cafe
Denise,2015-06-17,feed
Chuck,2015-06-19,beef
Bob,2015-06-19,d00d

mlr --csvlite rename -r (.*)e(.*),\1EEE\2 ./reg-test/input/date1.csv ./reg-test/input/date2.csv
NamEEE,DatEEE_201505,ExtranEEEous
Alice,2015-05-14,foo
Bob,2015-05-11,bar
Chuck,2015-05-28,quux
Denise,2015-05-02,meep

NamEEE,DatEEE_201506,ExtranEEEous
Alice,2015-06-23,cafe
Denise,2015-06-17,feed
Chuck,2015-06-19,beef
Bob,2015-06-19,d00d

mlr --csvlite rename -r "(.*)e(.*)"i,\1EEE\2 ./reg-test/input/date1.csv ./reg-test/input/date2.csv
NamEEE,DatEEE_201505,ExtranEEEous
Alice,2015-05-14,foo
Bob,2015-05-11,bar
Chuck,2015-05-28,quux
Denise,2015-05-02,meep

NamEEE,DatEEE_201506,ExtranEEEous
Alice,2015-06-23,cafe
Denise,2015-06-17,feed
Chuck,2015-06-19,beef
Bob,2015-06-19,d00d

mlr --csvlite rename -r -g "(.*)e(.*)"i,\1EEE\2 ./reg-test/input/date1.csv ./reg-test/input/date2.csv
NamEEE,DatEEE_201505,ExtranEEEous
Alice,2015-05-14,foo
Bob,2015-05-11,bar
Chuck,2015-05-28,quux
Denise,2015-05-02,meep

NamEEE,DatEEE_201506,ExtranEEEous
Alice,2015-06-23,cafe
Denise,2015-06-17,feed
Chuck,2015-06-19,beef
Bob,2015-06-19,d00d

mlr --csvlite rename -r ^(.a.e)(_.*)?,AA\1BB\2CC ./reg-test/input/date1.csv
AANameBBCC,AADateBB_201505CC,Extraneous
Alice,2015-05-14,foo
Bob,2015-05-11,bar
Chuck,2015-05-28,quux
Denise,2015-05-02,meep

mlr --csvlite rename -r "e",EEE ./reg-test/input/date1.csv ./reg-test/input/date2.csv
NamEEE,DatEEE_201505,ExtranEEEous
Alice,2015-05-14,foo
Bob,2015-05-11,bar
Chuck,2015-05-28,quux
Denise,2015-05-02,meep

NamEEE,DatEEE_201506,ExtranEEEous
Alice,2015-06-23,cafe
Denise,2015-06-17,feed
Chuck,2015-06-19,beef
Bob,2015-06-19,d00d

mlr --csvlite rename -r -g "e",EEE ./reg-test/input/date1.csv ./reg-test/input/date2.csv
NamEEE,DatEEE_201505,ExtranEEEous
Alice,2015-05-14,foo
Bob,2015-05-11,bar
Chuck,2015-05-28,quux
Denise,2015-05-02,meep

NamEEE,DatEEE_201506,ExtranEEEous
Alice,2015-06-23,cafe
Denise,2015-06-17,feed
Chuck,2015-06-19,beef
Bob,2015-06-19,d00d

mlr --csvlite rename -r "e"i,EEE ./reg-test/input/date1.csv ./reg-test/input/date2.csv
NamEEE,DatEEE_201505,EEExtraneous
Alice,2015-05-14,foo
Bob,2015-05-11,bar
Chuck,2015-05-28,quux
Denise,2015-05-02,meep

NamEEE,DatEEE_201506,EEExtraneous
Alice,2015-06-23,cafe
Denise,2015-06-17,feed
Chuck,2015-06-19,beef
Bob,2015-06-19,d00d

mlr --csvlite rename -r -g "e"i,EEE ./reg-test/input/date1.csv ./reg-test/input/date2.csv
NamEEE,DatEEE_201505,EEExtranEEEous
Alice,2015-05-14,foo
Bob,2015-05-11,bar
Chuck,2015-05-28,quux
Denise,2015-05-02,meep

NamEEE,DatEEE_201506,EEExtranEEEous
Alice,2015-06-23,cafe
Denise,2015-06-17,feed
Chuck,2015-06-19,beef
Bob,2015-06-19,d00d

