03-12-2012, 10:33 AM | #1 |
Junior Member
Posts: 7
Karma: 10
Join Date: Jan 2010
Device: Sony prs-505
|
Limit find to whole words.
Is there a way to limit Sigil 0.5.3 to finding only whole words in find and replace?
E.G. change color to colour but not Colorado to colourado Keeping the correct capitalisation would also be good! |
03-12-2012, 10:42 AM | #2 | |
Well trained by Cats
Posts: 30,448
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
If you include the trailing space in the search and replace (not tested) ([Cc])(olor ) \1olour <trailing space |
|
Advert | |
|
03-12-2012, 10:57 AM | #3 |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
\b([Cc])(olor)(s)?\b
\1olour\3 Last edited by DiapDealer; 03-12-2012 at 11:03 AM. |
03-12-2012, 11:25 AM | #4 |
Well trained by Cats
Posts: 30,448
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Nice catch
|
03-12-2012, 01:26 PM | #5 |
Guru
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
What about
(\b[Cc]olo)(r\b) replacing with \1u\2 |
Advert | |
|
03-12-2012, 01:55 PM | #6 |
Well trained by Cats
Posts: 30,448
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
03-12-2012, 02:56 PM | #7 |
Guru
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
O.K. then
(\b[Cc]olo)(r|rized?|red|ring|ration)\b |
03-13-2012, 06:16 AM | #8 | |
Junior Member
Posts: 7
Karma: 10
Join Date: Jan 2010
Device: Sony prs-505
|
OK so the answer is no simple way! Not sure I can be bothered to construct a regexp for every spelling correction. Hopefully the option to restrict the find/replace to whole words will arrive at some point.
Quote:
|
|
03-13-2012, 08:56 AM | #9 | |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
\bcolor\b Will find "color" but ignore "discoloration." It won't work as precisely for possessive words that have "'s" on them, but the 's can usually be ignored anyway. |
|
03-16-2012, 08:25 AM | #10 |
Junior Member
Posts: 7
Karma: 10
Join Date: Jan 2010
Device: Sony prs-505
|
I get the playfulness factor in that whenever regexp comes up in the forums people attempt to make the cleverest expression. My point was that from reading the documentation older versions of Sigil had an option to select whole word search in the find and replace window, this window is now gone and apparently so have some of the options. I thought that the options may have been placed somewhere that I had not found... Generally the more you have to type the more likely a mistake is, so I like simple solutions.
|
03-16-2012, 11:50 AM | #11 | |
Well trained by Cats
Posts: 30,448
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
There is a learning curve (says he as he still stumbles now and again). Get a REGEX cheat sheet and keep it handy |
|
Tags |
find, replace, sigil |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Find/Replace Won't Find | Rand Brittain | Sigil | 7 | 09-24-2011 05:35 AM |
Get Find to find an exact phrase | evwool | Amazon Kindle | 4 | 08-16-2011 09:47 AM |
50 char limit? | BrianG | Calibre | 2 | 01-25-2010 11:15 AM |
limit hyphenation | red_dragon | OpenInkpot | 2 | 02-27-2009 10:22 AM |
There Is A Limit | C6REW | Sony Reader | 20 | 09-06-2008 05:12 PM |