Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 12-11-2011, 06:30 AM   #1
BartB
Member
BartB began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Dec 2010
Location: Geelong, Australia
Device: Kobo
how do I span more than one line with regex

G'day,

I've trolled through the forum and looked elsewhere for the the magic switch that will allow me to collect the text between, say for example, <head> and </head>. I can get the regex to collect when all is on one line but, according to my searching, I need to tell Sigil to allow the dot to collect the newlines as well. How do I do that?

I am using <head>(.*?)</head> to do the finding and the collection.
BartB is offline   Reply With Quote
Old 12-11-2011, 07:32 AM   #2
Pablo
Guru
Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.
 
Pablo's Avatar
 
Posts: 970
Karma: 4999999
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-505, PRS-T2
Search for <head>(.+)</head> with "Regular Expression" and "Minimal matching" selected.
Pablo is offline   Reply With Quote
Advert
Old 12-11-2011, 03:28 PM   #3
BartB
Member
BartB began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Dec 2010
Location: Geelong, Australia
Device: Kobo
Thanks Pablo,

That worked. I note that I had to drop the "?". I'll need to study the Sigil manual and other references a bit more to understand why so that I can let others know if the future. Just in case you aren't around
BartB is offline   Reply With Quote
Old 12-11-2011, 05:12 PM   #4
Pablo
Guru
Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.
 
Pablo's Avatar
 
Posts: 970
Karma: 4999999
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-505, PRS-T2
Quote:
Originally Posted by BartB View Post
Thanks Pablo,

That worked. I note that I had to drop the "?". I'll need to study the Sigil manual and other references a bit more to understand why so that I can let others know if the future. Just in case you aren't around
I'm glad it worked. If you look for information, bear in mind that Sigil uses Qt regular expressions.
Pablo is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Average life span of a Kindle? jbcohen Amazon Kindle 19 10-02-2011 08:19 PM
Importing RegEx Line TheEldest Calibre 1 07-05-2011 10:18 PM
Remove <br /> together with span, and only span Razzia Recipes 3 05-30-2011 06:55 PM
'Heading color' and 'p class span' mufc Recipes 7 12-22-2010 09:02 PM
Insert new line with regex deckoff Sigil 6 08-08-2010 11:24 AM


All times are GMT -4. The time now is 10:51 AM.


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