![]() |
#1 |
Zealot
![]() Posts: 142
Karma: 10
Join Date: Jun 2014
Device: nook
|
Regex questions (body of text only?)
I found that Sigil can use Regex in it find/replace function.
I am looking to find all examples of x.x (where x is any letter with a period in between) Essentially, many words like book.case or back.pack that are compound words are displayed in my file as show above. I see that I can find all examples of this by using the code [a-z]\.[a-z] which is great, but it is also finding all examples in the actual code, such as www.xxxx Is there a way to tell Sigil to only look to find my search in the body of the text rather than in the code? If so, that would be excellent and fix a big problem for me. |
![]() |
![]() |
![]() |
#2 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
(no this doesn't work)
should find your search, but check for the preceding closing tag bracket (however far back that may be) and ensure that there is no opening tag bracket in between there and the matching text. Uses the power of negative lookarounds, see here: http://www.regular-expressions.info/lookaround.html (I checked for capital and lowercase, as you did not specify that you only wanted lowercase? Not sure if you forgot to check for uppercase or forgot to mention you were excluding them.) Last edited by eschwartz; 10-23-2014 at 09:03 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Zealot
![]() Posts: 142
Karma: 10
Join Date: Jun 2014
Device: nook
|
I tried to apply the code, but it didn't work.
I am a total novice, so I don't know what "opening tag bracket" to look for. [a-zA-Z]\.[a-zA-Z] worked fine, but the preceding part made it find nothing. Any more suggestions? |
![]() |
![]() |
![]() |
#4 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
lookarounds do not advance the search
![]() And this could be done a different way... if only lookbehind allowed variable-length strings. Fortunately, you can use the curly-bracket repeater for a finite variable-length string, but only in http://calibre-ebook.com's editor. Code:
(?<=>[^<]{,99999})[a-zA-Z]\.[a-zA-Z] In Sigil, you can use: Code:
(>[^<]*?)[a-zA-Z]\.[a-zA-Z] |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can I change body text from bold to normal? | Michaelus | Calibre | 13 | 07-28-2022 04:42 PM |
Searching ebook body/text across library-Is it Possible? | dnjmama | Library Management | 9 | 11-20-2014 10:41 AM |
Fonts in body text in iBooks | Oxford-eBooks | ePub | 1 | 11-15-2012 08:41 AM |
Preferred Publisher Font for Body Text? | DreamWriter | Amazon Kindle | 12 | 07-25-2012 04:15 AM |
Fonts for body text - a small study (long) | derangedhermit | Workshop | 9 | 08-25-2011 04:27 AM |