Thread: Regex examples
View Single Post
Old 02-02-2013, 09:55 AM   #188
Perkin
Fanatic
Perkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane Austen
 
Perkin's Avatar
 
Posts: 552
Karma: 23783
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300
I take it you're extracting, using a proper re-name util, then re-packing.
Search : (.*pg)\d{1,3}(\.jpg)
(stores all upto (and including) 'pg', discard the next digits, store extension)
Replace \1<whatever inserts counter>\2
so if ? is a number counter char \1???\2
(or depending on regex you'd need $ instead of \ for group replacement.

Last edited by Perkin; 02-02-2013 at 09:57 AM.
Perkin is offline   Reply With Quote