View Single Post
Old 02-11-2016, 01:40 PM   #5
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 579
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by kovidgoyal View Post
Using the Find expression

\u200c (regex mode)

works for me.
Ah. Of course. Thank you.

For anyone who's interested, the following regex-function replaces all matched characters with numeric entities:
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
    result = ''
    for c in match.group():
        result += '&#%d;' % ord(c)
    return result
Search for e.g. (\u200c|\u00ad) and "replace all" using this function.

Last edited by Phssthpok; 02-11-2016 at 02:16 PM.
Phssthpok is offline   Reply With Quote