Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 12-09-2019, 07:47 AM   #1
The_book
Zealot
The_book began at the beginning.
 
Posts: 100
Karma: 10
Join Date: Aug 2019
Device: none
regex function replacement

Will Sigil add regex function replacement like Calibre? Or will someone design a plugin like this?
The_book is offline   Reply With Quote
Old 12-09-2019, 08:16 AM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
The Sigil Search and Replace has long supported regular expressions. See the Sigil User's manual.
KevinH is offline   Reply With Quote
Advert
Old 12-09-2019, 08:48 AM   #3
najgori
Klak
najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'
 
najgori's Avatar
 
Posts: 174
Karma: 150374
Join Date: Sep 2011
Location: Belgrade, Serbia
Device: many
after search&replace in calibre you can compare code before and after replacement, so you can check for regex errors.
najgori is offline   Reply With Quote
Old 12-09-2019, 08:52 AM   #4
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Doitsu, pointed out calibre's ability to run python code inside search and replace in regex mode. This is easy for calibre as it is written in python. Sigil's approach would be plugins.
KevinH is offline   Reply With Quote
Old 12-09-2019, 08:59 AM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
That can not easily be done as Sigil does not use order preserving hashes for retaining attribute order (as attribute order is not significant in xhtml or xml). That type of QHash really does not exist in Qt. Hashes/dicts that retain order are built into python.

This is something on my wish list for Sigil 2.0 not 1.0. That said, a regex replacer "dry-run" sounds like it would be better as a plugin.

Quote:
Originally Posted by najgori View Post
after search&replace in calibre you can compare code before and after replacement, so you can check for regex errors.
KevinH is offline   Reply With Quote
Advert
Old 12-09-2019, 09:45 AM   #6
najgori
Klak
najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'najgori gives new meaning to the word 'superlative.'
 
najgori's Avatar
 
Posts: 174
Karma: 150374
Join Date: Sep 2011
Location: Belgrade, Serbia
Device: many
anyway, there is a lot programs that do same thing (diffchecker, textcompare...). notepad++ has compare plugin, and in my workflow really does not matter if i do it in calibre, sigil or notepad++.
thanx for fast answer.
najgori is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
RegEx Function: Title Case phossler Editor 29 07-04-2020 10:52 AM
Random number in Regex Function? nqk Editor 2 05-23-2017 11:47 PM
RegEx-Function and hyphenation problem scratch Editor 4 01-28-2017 12:44 PM
Regex Function about «» and “” senhal Editor 8 04-06-2016 02:12 AM
Regex replacement qsipl General Discussions 2 07-01-2014 04:28 PM


All times are GMT -4. The time now is 12:33 AM.


MobileRead.com is a privately owned, operated and funded community.