View Single Post
Old 09-28-2013, 06:05 AM   #22
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by automa View Post
Is there screenshot tutorial on how to use Regex on sigil?
Automa:

I think you may need to start with learning Regex first, but, if you wish to give it a go in Sigil, there's a pinned post at the top of the forum with some handy regex expressions. If you can afford it, I highly recommend Regex Buddy as a regex learning tool (It's about $40USD). If you have a good text/HTML editor, like NoteTab Pro, you can try some of the regex you see posted, above, therein, assuming it's PCRE-based (if it's NoteTab Pro, it is).

Once you have a handle on basic regex (and don't feel intimidated--it looks scary but is really just more advanced and fancy "search and replace" using logic), you can easily try it in the Sigil interface. Very simply, you would put your regex FIND expression in the Find box; you would put the "replace" regex in the "replace" box, make sure you've clicked "Regex" for Mode, and then make other selections as are needed (for example--Minimal Match, Dotall, Wrap, etc.).

You may wish to start out with a very simple expression, just for a Find, and do a count--see how that goes. Once you can find things using regex, you can go from one to the next, make sure you're getting the finds that you want. Then you can try a replace; again, do ONE only, and make sure that the result is what you want. When you first learn regex, as tedious as it is, you should not do "replace all" until you have it down.

This is the best "El Quickie" tutorial I can give you. I know that there are scads of regex websites out there, and I think (sorry, cannot remember who) one of the MR'ers has a lovely tutorial on the basics of regex, somewhere around here--Ducky will know and post it, if my memory is correct. Again, though, if you can afford it, you may wish to take Regex Buddy out for a spin. It's a complicated and confusing interface to look at and immediately master, but the learning curve is very fast, once you get past how "clunky" the teaching page looks. :-)

Hope that helps!

Hitch
Hitch is offline   Reply With Quote