![]() |
#1 |
Member
![]() Posts: 17
Karma: 10
Join Date: Jan 2022
Location: французская страна басков
Device: BooX Poke3
|
![]()
Hi,
I want (in French) to add a non-breaking space in front of the ";" or the "!" for example, in the search box I put [a-z]; or [a-z]! but what should I put in the replace box so that I don't lose the last character of the sentence? … of the sentence and not necessarily end of paragraph. Bonsoir, Je souhaite (en français) ajouter un espace insécable devant les ";" ou les "!" par exemple, dans recherche je mets [a-z]; ou [a-z]! mais que dois-je mettre dans remplacer pour ne pas perdre le dernier caractère de la phrase*?… pas nécessairement fin d'alinéa. Merci google pour la traduction en anglais ![]() |
![]() |
![]() |
![]() |
#2 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,190
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
I'd suggest searching for ([a-z]); or ([a-z])! and using \1 6 0 ;; or \1 6 0 ;! as the replace. Alternately, you could use & 8 2 3 9 ; (a narrow non-breaking space) if your font supports that glyph.
Remove the spaces between the digits of 160 or 8239 and the ; (needed to keep the characters visible). Last edited by DNSB; 02-06-2022 at 02:26 PM. Reason: Edited to make the nbsp and nnbsp space characters stay visible |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 517
Karma: 2268308
Join Date: Nov 2015
Device: none
|
To be able to put " !" in the replace box, use
Code:
(?<=\p{Ll})! |
![]() |
![]() |
![]() |
#4 |
Member
![]() Posts: 17
Karma: 10
Join Date: Jan 2022
Location: французская страна басков
Device: BooX Poke3
|
Code:
calibre, version 5.34.0 ERREUR : Exception non gérée: <b>IndexError</b>:no such group calibre 5.34 embedded-python: True is64bit: True Linux-5.13.0-28-generic-x86_64-with-glibc2.2.5 Linux ('64bit', 'ELF') ('Linux', '5.13.0-28-generic', '#31~20.04.1-Ubuntu SMP Wed Jan 19 14:08:10 UTC 2022') Python 3.8.5 Interface language: fr Successfully initialized third party plugins: Standard Ebooks (1, 0, 0) Traceback (most recent call last): File "calibre/gui2/tweak_book/boss.py", line 1116, in search File "calibre/gui2/tweak_book/search.py", line 1561, in run_search File "calibre/gui2/tweak_book/search.py", line 1468, in do_replace File "calibre/gui2/tweak_book/editor/widget.py", line 329, in replace File "calibre/gui2/tweak_book/editor/text.py", line 598, in replace IndexError: no such group |
![]() |
![]() |
![]() |
#5 |
Member
![]() Posts: 17
Karma: 10
Join Date: Jan 2022
Location: французская страна басков
Device: BooX Poke3
|
DNSB
Code:
calibre, version 5.34.0 ERREUR : Exception non gérée: <b>IndexError</b>:no such group calibre 5.34 embedded-python: True is64bit: True Linux-5.13.0-28-generic-x86_64-with-glibc2.2.5 Linux ('64bit', 'ELF') ('Linux', '5.13.0-28-generic', '#31~20.04.1-Ubuntu SMP Wed Jan 19 14:08:10 UTC 2022') Python 3.8.5 Interface language: fr Successfully initialized third party plugins: Standard Ebooks (1, 0, 0) Traceback (most recent call last): File "calibre/gui2/tweak_book/boss.py", line 1116, in search File "calibre/gui2/tweak_book/search.py", line 1561, in run_search File "calibre/gui2/tweak_book/search.py", line 1468, in do_replace File "calibre/gui2/tweak_book/editor/widget.py", line 329, in replace File "calibre/gui2/tweak_book/editor/text.py", line 598, in replace IndexError: no such group |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
I would use:
Code:
([a-z])([;!]) Code:
(\w)([;!]) With the replace being: Code:
\1 6 0 ;\2 Code:
\1& 8 2 3 9 ;\2 Last edited by davidfor; 02-06-2022 at 07:27 PM. Reason: Hit the wrong button. |
![]() |
![]() |
![]() |
#7 |
Member
![]() Posts: 17
Karma: 10
Join Date: Jan 2022
Location: французская страна басков
Device: BooX Poke3
|
Thank you very much, it works!
|
![]() |
![]() |
![]() |
#8 |
Chalut o/
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 439
Karma: 145424
Join Date: Dec 2017
Device: Kobo
|
Hello comrade francophone o/
To make your life easier in the future, when you add new books for example, I recommend the plugin Mass Search/Replace which allows allows to launch quickly and easily in 1 click a Search/Replace operation. Here is my list of operations for non-breaking spaces (and a little more). To add it in your plugin : right click > Import > In the window, select the file "unbreakable space.owip.zip" on your PC Français: Bonjour camarade francophone o/ Pour vous faciliter la vie a l'avenir, quand vous ajouter de nouveau livres par exemple, je vous recommande le plugin Mass Search/Replace qui vous permet de lancer rapidement et facilement en 1 clique une opération Search/Replace. Voici ci joint ma liste d'opération pour les espace insécable (et un peu plus). Pour l'ajouter dans votre plugin : clique droite > Importer > Dans la fenêtre, sélectionner le fichier "espace insécable.owip.zip" sur votre PC EDIT: Oh, it's for the editor, crap Last edited by un_pogaz; 02-07-2022 at 07:09 AM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bulk Edit Search & Replace expressions? | OldLincoln | Library Management | 6 | 01-14-2017 06:00 PM |
Regular Expressions search in Book Viewer | fncll | Library Management | 5 | 03-04-2016 04:52 PM |
Regular expressions in the replace field | markallanson | Editor | 5 | 09-06-2014 12:44 PM |
Help with regular expression search/replace | bfollowell | Sigil | 12 | 06-20-2013 07:36 PM |
Search & Replace - Regular expression | oldbwl | Calibre | 2 | 01-09-2011 09:33 AM |