View Single Post
Old 12-13-2018, 02:21 PM   #9
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Doitsu View Post
I rarely use Calibe Editor, but the following should work for you.
  • Paste <h1([^>]*)>([^<]+)</h1> in the Find box.
  • Select Regex-function from the Mode drop-down box.
  • Click Create/Edit, paste the following code in the Code box:


    Code:
    def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
        return '<h1' + match.group(1) + '>'  + match.group(2).replace('  ', '§').replace(' ', '').replace('§', ' ') + '</h1>'
    enter a function name, e.g. Ruben, and click OK.
Thank you very much Doitsu; your code worked like a charm!
RbnJrg is offline   Reply With Quote