01-06-2011, 03:43 AM | #1 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
regex to fix up hyphenated words please
i want to auto-remove extra spaces in hyphenated words
i.e. change badly- spaced to badly-spaced. not sure of the find +replace syntax. I think I have to find [word boundary]- [wordboundary] then replace what I've found but without the space ? |
01-06-2011, 04:08 AM | #2 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Could be handy, but not automatic I think. There are cases when that kind of syntax is correct. At least in dutch it can be.
|
Advert | |
|
01-06-2011, 04:13 AM | #3 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Try searching for "\b- \b" and replacing with "-" (no quotes in either case). According to the documentation, \b matches a word boundary, but no character (so you don't have to worry about it when replacing).
But, as Toxaris says, beware of things like "inter- and intramolecular bonds". |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Conversion and Regex Help | thedevilsjester | Calibre | 0 | 07-16-2010 06:10 PM |
What a regex is | Worldwalker | Calibre | 20 | 05-10-2010 05:51 AM |
Multiline Regex? | prky | Calibre | 25 | 05-01-2010 09:56 PM |
Help with a regex | A.T.E. | Calibre | 1 | 04-05-2010 07:50 AM |
Regex help... | Bobthebass | Workshop | 6 | 04-26-2009 03:54 PM |