Thread: search question
View Single Post
Old 04-02-2013, 07:50 PM   #6
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Gregg Bell View Post
Thanks Tex. Love the spell check feature and "show all words."
Works even better than I first imagined/requested. I remember having to program a "word count" program along those lines back in high school as one of our introductory programs to learn about string input, arrays, and using loops. I always imagined it would be incredibly useful as a spellcheck... and it is!

I have zero idea why your typical word processor does not have spellcheck functionality anywhere near what is in Sigil currently.

Quote:
Originally Posted by Gregg Bell View Post
And the regex thing \btext\b is just awesome.
Yeah, I learned about \b from someone on these forums (I forget the user), but once I saw it in usage, it was genius. (Perhaps it was in the sticky: Regex Examples.)

Quote:
Originally Posted by Gregg Bell View Post
This is my very first experience using Regex (I've always been a little intimidated by it) and thanks to you it's a great one. Appreciate it!
It is EXTREMELY powerful, and you have to be very careful sometimes to make sure you do not delete important information, especially when using symbols such as "+" (more than 1), or "*" (more than 0).

I learned most of my stuff from the Regex Tutorial:

http://www.regular-expressions.info/tutorial.html

I have a big Regex collection that I use all the time, most notably:

- A Sigil "group" to clean up all the ABBYY Finereader cruft
- Swapping footnotes from superscript footnotes -> [#] format
- Combining broken paragraphs (happens VERY often in OCR)
- "Fixing" the TOC code from Sigil (auto changing the Sigil format to match my "toc" classes in my CSS).

This is one that I use quite often to fix "en dashes" (See https://en.wikipedia.org/wiki/Dash#En_dash):

Search:

Code:
([0-9])-([0-9])
Replace:

Code:
\1–\2
This Regex will look for two numbers separated by a hyphen, and replace the hyphen with an en dash. I step through and replace one by one to make sure that the en dash belongs. Very helpful for adding them between page numbers/years.
Tex2002ans is offline   Reply With Quote