Quote:
Originally Posted by Mister L
Now that I see the result I understand it but I don't think I would have come up with it on my own so it's a good thing I asked for help. This should save me quite a bit of time. Today I was working on a book that had over 400 dashes in it and that's not even the record so you can see why I'd want to optimise my searches.
|
Definitely don't ever do a Replace All with something like that though, you won't know what sort of rogue madness might happen.

(And I didn't test on an odd number of en dashes.)
Quote:
Originally Posted by Mister L
I don't need to replace the dashes, I need to replace the spaces actually (in French we use non-breaking spaces with dashes but depending where the dash is the space goes either in front or in back so you can't just do "replace all"), but the "not a sentence" part is what was giving me trouble. Some authors like to sprinkle those things around like there was no other punctuation and you can have multiple dashes in one paragraph and not all of them are sets.
|
Find: – (\w*[^\.\?!]+?) –
Replace: – \1 –
Hopefully it works, and it will at least save you a lot of time. The rest can probably then be found with a simple:
Find: – <--- Put a space before or after the en dash