![]() |
#1 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 114
Karma: 6288
Join Date: Dec 2012
Device: iphone
|
Searching NOT
For the life of me I can't figure out how to do these 2 searches.
1. How would I search for </p> where the is NOT a . before it? The the first line would come up but the second one wouldn't. <p class="calibre11">But that didn’t mean he wanted to turn out</p> <p class="calibre11"> the lights and go to sleep either.</p> 2. Same problem different version. How would I search for </p> where it is followed by a character [a-z] instead of a < <p class="calibre11">But that didn’t mean he wanted to turn out</p> the lights and go to sleep either.</p> Any help would be greatly appreciated. TTRS |
![]() |
![]() |
![]() |
#2 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,908
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
searches for lowercase or comma or straight quote \1 \2 This will miss some words that start with a capital: eg Martha or a quote. Last edited by theducks; 01-22-2014 at 04:17 PM. Reason: full search added |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
1) Regex mode.
Code:
[^.]</p> Code:
[^.?!"']</p> Number two seems like a really odd search. Your code's in a lot of trouble if you have naked text immediately following a closing paragraph tag. But: Code:
</p>[a-z] Or if it should literally be anything OTHER than the beginning of a new tag... then: Code:
</p>[^<] |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
theducks's suggestion is, of course, perfectly fine, however, if you want to merge sentences, you might find this extended expression helpful that I use to merge sentences:
Find: ([[:lower:]],*;*:*)</p>\s+<p[^>]*>\s*([[:lower:]]) Replace: \1 \2 This expression will search for: - a single lower case character followed by zero or more commas, semi-colons or colons - followed by </p>, - followed by one or more white-spaces (including line-breaks), - followed by <p> (with optional attributes), - followed by zero or more spaces and a single lower-case character. |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
These are the three regex I use.
Regex #1: This catches all hyphenation at the end of the paragraphs. I replace this in a case by case basis just to make sure the combined word does not actually require the hyphen. Code:
-</p>\s+<p> Code:
(NOTHING, just a complete blank) Code:
<p>This is a paragraph which has a hyphen-</p> <p>ated paragraph.</p> Code:
([^>”\?\!\.])</p>\s+<p> Code:
\1
Code:
<p>This is a sample,</p> <p>of a paragraph that will</p> <p>be caught by the regex above.</p> Code:
<p>[a-z] Code:
<p>In 2014, Tex gave an informative sample:</p> <blockquote><p>Here is a quote.</p></blockquote> <p>here is more information.</p> Other oddities such as semi-colons or colons will be pointed out by Regex #2, and those can be fixed on a case-by-case basis. (Sometimes they should be combined, sometimes they should not). I keep these three in my Sigil Saved Searches (Tools - Saved Searches). More info on how to use Saved Searches can be found here: http://web.sigil.googlecode.com/git/..._searches.html |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
searching for books on the go | curious | Library Management | 10 | 07-23-2013 02:18 PM |
Amazon searching | LuvReadin | General Discussions | 5 | 05-17-2012 03:24 PM |
Been searching, need help!! | SpaceKake | Which one should I buy? | 1 | 10-04-2011 07:21 AM |
Searching your library | Dr. T | enTourage Archive | 3 | 12-09-2010 01:01 PM |
Searching on the Kindle | bob315 | Amazon Kindle | 13 | 12-01-2007 04:42 PM |