View Single Post
Old 09-30-2021, 11:25 PM   #7
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,622
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Ok, I figured it out. My Search Regex was wrong.

I changed it to this...
PHP Code:
(<h2><span class="hide">)(\s–\s)(</span></h2>) 
And adjusted "incr_chapter_number" to...
PHP Code:
def replace(matchnumberfile_namemetadatadictionariesdatafunctions, *args, **kwargs):
    
data.setdefault('chapnum'19)
    
    if 
match.group(2): 
        
data['chapnum'] += 1
        
return match.group(1) + str(data['chapnum']) + match.group(2) + match.group(3)
    return  
match.group(0
And now it works correctly.

Do you know of any way to convert Number to Word eg 17 to Seventeen?
Karellen is offline   Reply With Quote