04-27-2018, 01:57 AM | #1 |
Enthusiast
Posts: 46
Karma: 10
Join Date: Jun 2013
Device: Samsung Galaxy Tab A 8"
|
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 |
04-27-2018, 02:36 AM | #2 |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
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\> |
04-27-2018, 02:52 AM | #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> |
04-27-2018, 10:19 AM | #4 |
Enthusiast
Posts: 46
Karma: 10
Join Date: Jun 2013
Device: Samsung Galaxy Tab A 8"
|
|
04-27-2018, 10:21 AM | #5 |
Enthusiast
Posts: 46
Karma: 10
Join Date: Jun 2013
Device: Samsung Galaxy Tab A 8"
|
See below.
Last edited by jvorzimmer; 04-27-2018 at 10:29 AM. |
04-27-2018, 10:24 AM | #6 |
Enthusiast
Posts: 46
Karma: 10
Join Date: Jun 2013
Device: Samsung Galaxy Tab A 8"
|
|
04-27-2018, 05:19 PM | #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> |
04-27-2018, 10:07 PM | #8 |
Enthusiast
Posts: 46
Karma: 10
Join Date: Jun 2013
Device: Samsung Galaxy Tab A 8"
|
That works!
|
04-28-2018, 01:50 AM | #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>
|
04-28-2018, 09:48 AM | #10 |
Enthusiast
Posts: 46
Karma: 10
Join Date: Jun 2013
Device: Samsung Galaxy Tab A 8"
|
Thank you. I really appreciate it.
|
04-28-2018, 10:58 AM | #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 |
|
Similar Threads | ||||
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 |