Since I haven't used (?s) before I was testing it out in 0.4.904. The head example above works fine, but when I modified it it didn't always work. It looks like it should, but it doesn't - so I'm interested in what I'm doing wrong, if this is what its supposed to do, or if there is a code issue.
Below is a short extract of a gutenberg book picked at random. Start Sigil with an empty book and go to Code View. Delete all the lines in the window. Paste the text below into the window.
Put your cursor at the top and hit ctrl-f to bring up Find&Replace. Set Regex in Current File. Enter the Find expression (meaningless text split across lines):
Press the find button - it correctly highlights from Stoker on line 9 to Release on line 31
Now put your cursor on line 28 - just before the line with Stoker in it, and press the Find button again. This time it says the search term is not found.
In fact, it appears this is even simpler to demonstrate.
Put your cursor on say line 31 at the start of 'class' then do a Find for ".*Release" (without quotes) - search term is not found. Now put your cursor at the very start of line 31 (or on line 30) and repeat the find - this time the line up to and including Release is highlighted. In 0.4.2 Find correctly highlights the subset of the line up to and including the word even if the cursor is not at the start of the line. Searching for Release.* correctly highlights the word and rest of line.
And its easily checked if you just open Sigil with an empty file and change to code view and search for .*encoding with the cursor at the start of the line or a couple characters in, but since I already entered the test book I figured I'd leave it in the post.
Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="HTML Tidy for Linux (vers 7 December 2008), see www.w3.org" name="generator" />
<title>The Project Gutenberg eBook of Dracula's Guest, by Bram Stoker</title>
<meta content="Project Gutenberg EPUB-Maker v0.02 by Marcello Perathoner <webmaster@gutenberg.org>" name="generator" />
<link href="../Styles/0.css" rel="stylesheet" type="text/css" />
<link href="../Styles/1.css" rel="stylesheet" type="text/css" />
<link href="../Styles/pgepub.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1 id="pgepubid00000">The Project Gutenberg eBook, Dracula's Guest, by Bram Stoker</h1>
<div class="pgmonospaced pgheader">
<br />
This eBook is for the use of anyone anywhere at no cost and with<br />
almost no restrictions whatsoever. You may copy it, give it away or<br />
re-use it under the terms of the Project Gutenberg License included<br />
with this eBook or online at <a>www.gutenberg.org</a><br />
</div>
<p class="noindent">Title: Dracula's Guest</p>
<p class="noindent">Author: Bram Stoker</p>
<p class="noindent">Release Date: November 20, 2003 [eBook #10150]<br />
[Most recently updated: November 7, 2006]</p>
<p class="noindent">Language: English</p>
<p class="noindent">Character set encoding: ISO-8859-1</p>
<p class="noindent">***START OF THE PROJECT GUTENBERG EBOOK DRACULA'S GUEST***</p>
</body>
</html>