View Single Post
Old 07-31-2016, 06:45 PM   #5
beic
Member
beic began at the beginning.
 
Posts: 19
Karma: 10
Join Date: May 2016
Location: Espaņa
Device: Oasis 3G
Thank you! I was trying to run the regex in the conversion Search & Replace tool, not the book editor

In the end I used a Regex-Function because I had a lot of characters to replace.

Past this into the find box so it will only replace text within HTML tags

Code:
>[^<>]+<
Then run a simple replace Regex-Function

Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
    return match.group().replace('CH', 'Ċ').replace('GH', 'Ġ').replace('BH', 'Ḃ').replace('DH', 'Ḋ').replace('FH', 'Ḟ').replace('MH', 'Ṁ').replace('PH', 'Ṗ').replace('SH', 'Ṡ').replace('TH', 'Ṫ').replace('Ch', 'Ċ').replace('Gh', 'Ġ').replace('Bh', 'Ḃ').replace('Dh', 'Ḋ').replace('Fh', 'Ḟ').replace('Mh', 'Ṁ').replace('Ph', 'Ṗ').replace('Sh', 'Ṡ').replace('Th', 'Ṫ').replace('ch', 'ċ').replace('gh', 'ġ').replace('bh', 'ḃ').replace('dh', 'ḋ').replace('fh', 'ḟ').replace('mh', 'ṁ').replace('ph', 'ṗ').replace('sh', 'ṡ').replace('th', 'ṫ').replace('&', '⁊')
Hopefully this helps someone else.
beic is offline   Reply With Quote