![]() |
A quick and dirty solution would be:
Find: (chapter) ([[:lower:]]+) Replace: \u\1 \u\2 This requires Sigil 0.5.3 (or higher). |
Quote:
Quote:
|
Quote:
AFAIK, Calibre uses the Python regular expression library, which doesn't support the \u operator. The expressions that I suggested will work in Sigl or any text editor with PCRE support. Is there any particular reason why want to use Calibre to replace the text? |
Quote:
|
@Doitsu/Jellby
I was reading through the regex sticky and posted my question before realizing which software forum I was in. I have been able to glean very helpful information. Though the other forum has a regex sticky it does not seem as detailed as this one. I have moved my query here. |
I hate my first post to be a question rather than an answer but needs must when the devil drives.
I have an epub where speech quotes are missing from the start of the line e.g. Quote:
This seems to work (I know there are cases where it fail, but I'm just finding and not auto-fixing) Quote:
Is there something special about Sigil's regex that I'm overlooking? Many thanks in advance |
IMHO, the problem is \w*\W*, which matches a sequence of 0 or more word characters followed by 0 or more non-word characters. I.e., it will at most match one word plus a space or punctuation character. Try .*? instead:
Code:
"\>[^"](.*?)" |
Quote:
Outside of Sigil the regex that I was using worked fine which is what I'm finding odd. Using Quote:
Quote:
Need to think about this, I'm missing something really obvious :smack: |
Quote:
|
Strange issue
Most surely, I'm not understanding this the right way.
I'm cleaning up some epubs and have noticed that some of them have anchor tags with a class and an id but without any hyperlink. Some epubs have several hundred in between the text. So I'm using this regex to find anchor links with nothing inside them Quote:
I would like to be able to restrict the findings to only this situation. Many thanks! |
Quote:
|
I'm not certain why that expression would match instances with spans or text inside the anchor tags. It shouldn't really.
You might try: Code:
<a class="([^>]*?)" id="([^>]*?)"></a>But I can't get your expression to misbehave, really. It seems to do (for me anyway) what you've intended it to do. Can you give any examples of code it's matched that you don't think it should match? |
Quote:
which is why it is matching </span></a> if your id has an ending numbers use that to narrow the scope:(.+?\d+)"></a> |
Quote:
The whole red part would be matched by the first (.*?), right? |
Thanks, Doitsu and DiapDealer
This is from Clive Barker's Imajica Using Quote:
Clicking on Find, the first match is this one: Quote:
Quote:
Strange. |
| All times are GMT -4. The time now is 07:52 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.