Quote:
Originally Posted by Noirtier
Thank you very much for the suggestion! I have installed it now. All of those four options appear to be based solely on the number of hyphens to be found, without taking into account the presence of spaces or not. In my experience, the number of hyphens people employ in place of dashes is always two, with the only variability being whether they include spaces on either side or not.
|
Then you will want to create 2 Regular Expressions:
Regex #1: SPACE + 2 HYPHENS + SPACE -> EN DASH
- Find: ( )--( )
- Replace: \1–\2
Regex #2: LETTER + 2 HYPHENS + LETTER -> EM DASH
- Find: (\w)--(\w)
- Replace: \1—\2
That would take your examples:
Code:
...text -- text...
...text--text...
and convert them into:
Code:
...text – text...
...text—text...
- - -
Side Note: In Sigil, I make heavy use of the "Saved Searches" feature in:
You can even use "Groups" to run batches of search/replaces in 1 button press. See:
This allows you to save your common search/replaces, and easily run them in the future on any books.
You can do similar in Calibre's Editor, except it's in a slightly different location: