View Single Post
Old 11-24-2015, 02:23 AM   #3
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 564
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf
Thank you. I will try to play with that. I'm no programmer, though.

What I did is search for "#n(\d+)" (in #n1, for example)
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
    text='#'
    text2= '_'
    return text + file_name + text2 + match.group(1)
And it would return:
#OEBPS/1.html_1

I would only want:
#1_1

(of course, i could use regex to clean the unwanted portion afterward, but I would be nicer to have it done in one regex function, and I could learn something as well)

Last edited by nqk; 11-24-2015 at 02:32 AM.
nqk is offline   Reply With Quote