Thread: Regex examples
View Single Post
Old 08-06-2012, 01:04 PM   #118
Danger
Evangelist
Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.
 
Danger's Avatar
 
Posts: 490
Karma: 1665031
Join Date: Nov 2010
Location: Vancouver Island, Nanaimo
Device: K2 (retired), Kobo Touch (passed to the wife), KGlo, Galaxy TabPro
Quote:
Originally Posted by Timur View Post
@Danger: In most regex flavors dot(.) does not match newline characters by default. Your case requires the dot to match newlines. In Sigil either select Regex Dotall from the mode listbox(beta version does not have that mode iirc), or append (?s) in front of your find pattern. Example:

Code:
(?s)<div class="story" id="part-\d+">(.*)</div>
Awesome, I knew it wasn't matching newlines but couldn't figure out how to get it to do so. Thank you Timur, that works great.
Danger is offline   Reply With Quote