Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-12-2012, 10:33 AM   #1
aerosol_grey
Junior Member
aerosol_grey began at the beginning.
 
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!
aerosol_grey is offline   Reply With Quote
Old 03-12-2012, 10:42 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by aerosol_grey View Post
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!


If you include the trailing space in the search and replace (not tested)

([Cc])(olor )

\1olour <trailing space
theducks is offline   Reply With Quote
Advert
Old 03-12-2012, 10:57 AM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
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.
DiapDealer is offline   Reply With Quote
Old 03-12-2012, 11:25 AM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
theducks is offline   Reply With Quote
Old 03-12-2012, 01:26 PM   #5
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
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

Perkin is offline   Reply With Quote
Advert
Old 03-12-2012, 01:55 PM   #6
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by Perkin View Post
What about
(\b[Cc]olo)(r\b)

replacing with
\1u\2

I was remarking on including the plural but them it should probably also include : colorize,colored, coloring
theducks is offline   Reply With Quote
Old 03-12-2012, 02:56 PM   #7
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
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

Perkin is offline   Reply With Quote
Old 03-13-2012, 06:16 AM   #8
aerosol_grey
Junior Member
aerosol_grey began at the beginning.
 
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:
(\b[Cc]olo)(r|rized?|red|ring|ration)\b
By the way colorized should become colourised in UK spelling so you might like to make this a little more complex!
aerosol_grey is offline   Reply With Quote
Old 03-13-2012, 08:56 AM   #9
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Hopefully the option to restrict the find/replace to whole words will arrive at some point.
I think you misunderstood some of our playfulness. The \b will work to isolate whole words. The functionality you want is already there.

\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.
DiapDealer is offline   Reply With Quote
Old 03-16-2012, 08:25 AM   #10
aerosol_grey
Junior Member
aerosol_grey began at the beginning.
 
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.
aerosol_grey is offline   Reply With Quote
Old 03-16-2012, 11:50 AM   #11
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by aerosol_grey View Post
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.
The old (non-PCRE) version also did not allow lots of REGEX things to be done.
There is a learning curve (says he as he still stumbles now and again).
Get a REGEX cheat sheet and keep it handy
theducks is offline   Reply With Quote
Reply

Tags
find, replace, sigil


Forum Jump

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


All times are GMT -4. The time now is 12:21 AM.


MobileRead.com is a privately owned, operated and funded community.