![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
regex for character replacement, em-dash questions
I'm hoping to learn how to fix up various small annoyances in conversions via regex & have some related questions.
1. em-dash, en-dash - to mess with these, how do I type the characters into the regex i.e. is there a way to generate an emdash or endash with the keyboard ? 2. find + replace syntax: I see lots of helpful examples for removing stuff with regex but what is the generic construction of a find / replace all command 3. as a specific, I could fix up one book if I could replace all "?" with em dash, EXCEPT for those ? which are followed by a close speech quote. this would take 3 passes in word: 1. change all ?" to , say, QMQM". 2 change all "?" to em dash. 3 change all QMQM back to ?" PS following a link to here https://wiki.mobileread.com/wiki/Special_characters I read that em-dash, en-dash are NOT supported on Kindle, but it does not say what would be displayed if one was included in a .mobi file - I assume that the .mobi spec does support them ? Last edited by cybmole; 10-18-2010 at 02:29 AM. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
I don't think Calibre can do search & replace on book contents at all. As for regex construction, those follow the same rules in other programs as they do in Calibre (though caveats may apply, e.g. Notepad++ doesn't allow regex matching across linebreaks). Go read a tutorial, if you need to learn regexes.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
just wanted to be sure I was not missing any simpler route. I thought there might be an option to use a character conversion table so that,say, all instances of en-dash ( not supported on Kindle) can be replaced with a character that is supported. Maybe that already happens ? |
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,248
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
If you can see m-dash/n-dash, curly quotes etc in your source file and you want ordinary dashes and quotes in the converted file, then a simple check of the box 'Transliterate unicode chars to ASCII' on the Convert - Look&Feel page should be enough.
However, if the source has already 'lost' the special chars to ?'s then I'm afraid you're stuck with using an editor and guesswork on your source. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
FB2's and Em-dash | Soxendom | Workshop | 1 | 10-13-2010 02:27 PM |
RegEx REPLACEMENT: Help needed! | LARdT | Sigil | 12 | 01-04-2010 07:25 PM |
[2.0] "em dash" character not displayed | superanima | Bookeen | 4 | 12-27-2009 07:06 AM |
Getting a warranty replacement, have questions | Dragoro | Amazon Kindle | 1 | 10-20-2009 01:02 AM |
Creator The em dash | Argel | Kindle Formats | 8 | 07-12-2008 08:45 AM |