|
|
#1 |
|
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Jan 2010
Device: Sony prs-505
|
Limit find to whole words.
E.G. change color to colour but not Colorado to colourado Keeping the correct capitalisation would also be good! |
|
|
|
|
|
#2 | |
|
Staff to 4 Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,741
Karma: 2485850
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2,Black Astak PEz, K4NT(now Wifes)
|
Quote:
![]() If you include the trailing space in the search and replace (not tested) ([Cc])(olor ) \1olour <trailing space
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
|
|
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,840
Karma: 23400772
Join Date: Jan 2010
Device: Kindle Fire HD, Kindle 2
|
\b([Cc])(olor)(s)?\b
\1olour\3
__________________
“Politics: A strife of interests masquerading as a contest of principles. The conduct of public affairs for private advantage.” Last edited by DiapDealer; 03-12-2012 at 10:03 AM. |
|
|
|
|
|
#4 |
|
Staff to 4 Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,741
Karma: 2485850
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2,Black Astak PEz, K4NT(now Wifes)
|
Nice catch
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
|
|
|
|
|
|
#5 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 552
Karma: 23783
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300
|
What about
(\b[Cc]olo)(r\b) replacing with \1u\2
|
|
|
|
|
|
#6 |
|
Staff to 4 Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,741
Karma: 2485850
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2,Black Astak PEz, K4NT(now Wifes)
|
I was remarking on including the plural but them it should probably also include : colorize,colored, coloring
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
|
|
|
|
|
|
#7 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 552
Karma: 23783
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300
|
O.K. then
(\b[Cc]olo)(r|rized?|red|ring|ration)\b
|
|
|
|
|
|
#8 | |
|
Junior Member
![]() Posts: 6
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:
|
|
|
|
|
|
|
#9 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,840
Karma: 23400772
Join Date: Jan 2010
Device: Kindle Fire HD, Kindle 2
|
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.
__________________
“Politics: A strife of interests masquerading as a contest of principles. The conduct of public affairs for private advantage.” |
|
|
|
|
|
|
#10 |
|
Junior Member
![]() Posts: 6
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.
|
|
|
|
|
|
#11 | |
|
Staff to 4 Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,741
Karma: 2485850
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2,Black Astak PEz, K4NT(now Wifes)
|
Quote:
There is a learning curve (says he as he still stumbles now and again).Get a REGEX cheat sheet and keep it handy
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
|
|
|
|
|
![]() |
| Tags |
| find, replace, sigil |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find/Replace Won't Find | Rand Brittain | Sigil | 7 | 09-24-2011 04:35 AM |
| Get Find to find an exact phrase | evwool | Amazon Kindle | 4 | 08-16-2011 08:47 AM |
| 50 char limit? | BrianG | Calibre | 2 | 01-25-2010 10:15 AM |
| limit hyphenation | red_dragon | OpenInkpot | 2 | 02-27-2009 09:22 AM |
| There Is A Limit | C6REW | Sony Reader | 20 | 09-06-2008 04:12 PM |