Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-12-2012, 09:33 AM   #1
aerosol_grey
Junior Member
aerosol_grey began at the beginning.
 
Posts: 6
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, 09:42 AM   #2
theducks
Staff to 4 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: 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:
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
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
theducks is offline   Reply With Quote
 
Enthusiast
Old 03-12-2012, 09: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: 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.
DiapDealer is offline   Reply With Quote
Old 03-12-2012, 10:25 AM   #4
theducks
Staff to 4 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: 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
theducks is offline   Reply With Quote
Old 03-12-2012, 12:26 PM   #5
Perkin
Fanatic
Perkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane Austen
 
Perkin's Avatar
 
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

Perkin is offline   Reply With Quote
Old 03-12-2012, 12:55 PM   #6
theducks
Staff to 4 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: 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:
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
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
theducks is offline   Reply With Quote
Old 03-12-2012, 01:56 PM   #7
Perkin
Fanatic
Perkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane AustenPerkin has memorized the entire works of Homer, Shakespeare, and Jane Austen
 
Perkin's Avatar
 
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

Perkin is offline   Reply With Quote
Old 03-13-2012, 05:16 AM   #8
aerosol_grey
Junior Member
aerosol_grey began at the beginning.
 
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:
(\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, 07: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: 6,840
Karma: 23400772
Join Date: Jan 2010
Device: Kindle Fire HD, Kindle 2
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.
__________________
Politics: A strife of interests masquerading as a contest of principles. The conduct of public affairs for private advantage.
DiapDealer is offline   Reply With Quote
Old 03-16-2012, 07:25 AM   #10
aerosol_grey
Junior Member
aerosol_grey began at the beginning.
 
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.
aerosol_grey is offline   Reply With Quote
Old 03-16-2012, 10:50 AM   #11
theducks
Staff to 4 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: 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:
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
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
theducks is offline   Reply With Quote
Reply

Tags
find, replace, sigil

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 11:34 PM.


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