![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54
Karma: 186734
Join Date: Jun 2013
Device: Samsung Galaxy Tab A9+
|
Regex Search in Calibre Question
I'm trying to create a regex search in Calibre that finds unmatched smart quotes.
With this search I can find open quotes in a paragraph without a matching close quote: “[^”]+\</p\> I also have tried to create corollary search that finds close quotes without an open quote. But this search will only match a line if the quote is missing at the beginning of a paragraph, even if it's further on in the paragraph: \<p.*\"\>[^“].*”.*\<\/p\> What am I doing wrong here? Any help would be appreciated. Thanks, Jeff |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
I can't test it at the moment, but I think the following is what you need:
Code:
\<p.*?\>[^“]*”.*\<\/p\> |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Interested in the matter
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
|
Can this help you?
<p[^“]*”.*</p> |
![]() |
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54
Karma: 186734
Join Date: Jun 2013
Device: Samsung Galaxy Tab A9+
|
|
![]() |
![]() |
![]() |
#5 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54
Karma: 186734
Join Date: Jun 2013
Device: Samsung Galaxy Tab A9+
|
See below.
Last edited by jvorzimmer; 04-27-2018 at 10:29 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54
Karma: 186734
Join Date: Jun 2013
Device: Samsung Galaxy Tab A9+
|
|
![]() |
![]() |
![]() |
#7 |
Interested in the matter
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
|
Let's see if this can help you.
<p[^“/]*”.*</p> |
![]() |
![]() |
![]() |
#8 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54
Karma: 186734
Join Date: Jun 2013
Device: Samsung Galaxy Tab A9+
|
That works!
|
![]() |
![]() |
![]() |
#9 |
Interested in the matter
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
|
It is to avoid matching with </p>
![]() |
![]() |
![]() |
![]() |
#10 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54
Karma: 186734
Join Date: Jun 2013
Device: Samsung Galaxy Tab A9+
|
Thank you. I really appreciate it.
|
![]() |
![]() |
![]() |
#11 |
Interested in the matter
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
|
You are welcome.
|
![]() |
![]() |
![]() |
Tags |
calibre, quotes, regex, unbalanced, unmaatched |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regex in search problems (NOT Search&Replace; the search bar) | lairdb | Calibre | 3 | 03-15-2017 07:10 PM |
Regex Search doesn't search all files in Edit Book | GregTheGrate | Editor | 8 | 11-08-2016 12:47 AM |
Request: multi-search and multi-replace regex question | iienderii | Library Management | 1 | 04-17-2016 03:15 PM |
What is format to search for unicode in calibre with regex? | mrmikel | Editor | 4 | 01-15-2014 06:33 AM |
calibre search & replace question | Kelby | ePub | 1 | 09-29-2011 01:14 PM |