Thread: Regex examples
View Single Post
Old 02-02-2013, 04:49 PM   #189
Sabardeyn
Fanatic
Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.
 
Sabardeyn's Avatar
 
Posts: 552
Karma: 1239646
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
Perkin,
Thanks for understanding what I'm doing despite me leaving the extract/fix/repack process unmentioned. I did however leave you with a bad example - that was the output, not the input.

The thing is, I cannot use "pg" as that is something I am adding. Basically the input files are variously named but with numbers at the end.

So a more realistic input page might be:
Terminator 2 23.jpg
that I want to rename into:
Terminator 2 -- ch14 pg023.jpg

There are other naming issues, but I've managed to handle them. Perhaps not optimally, but they get the job done. I just can't seem to isolate the numbers at the end of the filename and strip them. To the best of my knowledge my bulk renamer is using python flavored regex.

I haven't tried you code yet, but I will.
Sabardeyn is offline   Reply With Quote