Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 08-19-2019, 01:15 PM   #616
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by roger64 View Post
@Doitsu
I did not find any magic button to reverse the order of the files.
I was referring to the Name arrow in the Select Files dialog box.
Attached Thumbnails
Click image for larger version

Name:	reverse-order_arrow.png
Views:	314
Size:	81.3 KB
ID:	173039  
Doitsu is offline   Reply With Quote
Old 08-19-2019, 02:52 PM   #617
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)


Thank you Doitsu. Indeed... You know me too well by now...
roger64 is offline   Reply With Quote
Advert
Old 10-11-2019, 01:37 PM   #618
BillPearl
Junior Member
BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.
 
Posts: 7
Karma: 591908
Join Date: Jun 2011
Device: Kindle
Here are a pile of 'code error' corrections I have accumulated over time. Few are mine, most are from generous people who have shared their efforts. Thanks to all of you.
Suggest you copy and paste into a new text file.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~
FIND / REPLACE text (use with tags)
For a string of letters and numbers
([^>]+)(.*?)
eg.
<a name="Chapter_LIII" id="Chapter_LIII"></a>
<a([^>]+)(.*?)></a>
or
<body id="0-a5e9337bbdff40f4b38c8f20e5723a9a" class="calibre">
Find id="0-a5e9337bbdff40f4b38c8f20e5723a9a"
With id=([^>]+)(.*?) class

some text like, id=, then ([^>]+)(.*?) and then something to end string of letters & numbers

Find number in <b> in Regex mode
<b>[0-9]+</b>

Find Roman Numerals
lower or UPPER CASE
[xvi]+
[XVI]+ \>I[XVI]+

[1 space]
\[\s]

Find I, II, III
<p>[I]+</p>

Find Pg ### in Regex mode (?DotAll)
[P][g] (\d+)
[P][g] [xvi]+

Find Page_394 in Regex mode (?DotAll)
\Q"Page_\E(\d+)"

Find id="sigil_toc_id_3"
\Qid="sigil_toc_id_\E(\d+)"


[^\.] will match anything but . eg [^\.>]</

[,;:] will match any punctuation except period
[^,;:], where ^ stands for NOT in the character set.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~

Last edited by DiapDealer; 10-12-2019 at 10:44 AM.
BillPearl is offline   Reply With Quote
Old 10-11-2019, 01:55 PM   #619
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Can you please remove all but the first few regex examples/solutions? This thread is for regex examples/tips/issues only.
DiapDealer is offline   Reply With Quote
Old 10-11-2019, 04:58 PM   #620
doubleshuffle
Unicycle Daredevil
doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.
 
doubleshuffle's Avatar
 
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
But can you then post the rest in its own thread? Looks quite useful as well. Thanks.
doubleshuffle is offline   Reply With Quote
Advert
Old 10-11-2019, 06:16 PM   #621
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by doubleshuffle View Post
But can you then post the rest in its own thread? Looks quite useful as well. Thanks.
Yes. Sorry. I guess I should have mentioned that!
DiapDealer is offline   Reply With Quote
Old 10-11-2019, 09:34 PM   #622
BillPearl
Junior Member
BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.BillPearl ought to be getting tired of karma fortunes by now.
 
Posts: 7
Karma: 591908
Join Date: Jun 2011
Device: Kindle
Sorry to have to ask but where and how do I edit my post. You're right about my topic going 'off topic'.
BillPearl is offline   Reply With Quote
Old 10-12-2019, 05:54 AM   #623
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by BillPearl View Post
Sorry to have to ask but where and how do I edit my post. You're right about my topic going 'off topic'.
If you don't see an Edit button at the bottom of your post, it may be due to a temporary restriction on new members. If you create a new thread with all the non-regex tips in it, I'll take care of editing the post in this thread for you.
DiapDealer is offline   Reply With Quote
Old 04-13-2020, 05:35 AM   #624
Skydancer
Enthusiast
Skydancer began at the beginning.
 
Skydancer's Avatar
 
Posts: 30
Karma: 10
Join Date: Mar 2019
Location: Slovenia
Device: PocketBoot Inkpad 3
I need some help... After OCR there are occasional punctuation errors like this in the text:

Wrong:
Quote:
»Lorem »ipsum dolor‘ sit amet, consectetur adipiscing elit.«
AND:
Lorem »ipsum dolor‘ sit amet, consectetur adipiscing elit.
Correct:
Quote:
»Lorem ,ipsum dolor‘ sit amet, consectetur adipiscing elit.«
AND:
Lorem ,ipsum dolor‘ sit amet, consectetur adipiscing elit.
The quotation marks used here (‘…’) are curvy/smart, not dumb.

I got this far:
Code:
Find:
».*?([a-z])\‘
... but it's probably too greedy, and I can't get the Replace to work properly.

Last edited by Skydancer; 04-13-2020 at 05:39 AM.
Skydancer is offline   Reply With Quote
Old 04-13-2020, 05:58 AM   #625
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
@Skydancer:

The following should work for you:

Find:»([^»|‘]+)‘
Replace:,\1‘
Doitsu is offline   Reply With Quote
Old 04-13-2020, 06:57 AM   #626
Skydancer
Enthusiast
Skydancer began at the beginning.
 
Skydancer's Avatar
 
Posts: 30
Karma: 10
Join Date: Mar 2019
Location: Slovenia
Device: PocketBoot Inkpad 3
Thank you, @Doitsu!
That got me off to a good start. I modified your regex just a tiny bit so now it works perfectly:

Code:
»([^»,|‘]+)‘

Last edited by Skydancer; 04-13-2020 at 07:04 AM.
Skydancer is offline   Reply With Quote
Old 04-16-2020, 03:01 PM   #627
Mister L
Groupie
Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Posts: 159
Karma: 91148
Join Date: Jun 2010
Device: Sony 350
I have a feeling the answer for this is going to seem simple once someone tells me but my brain is not working properly at the moment so... if anyone can help...

I want to find sets of em dashes with some text between them that are in the *same sentence*. So the text between the em dashes cannot include .!? but can include ,;: for example.

For example:

Match:

Sanctuaire – là encore situé à Eyralice – abritait

Don't match (the . in this example could be ? or !):

les Ténèbres – et de valoir la mort à qui le possédait. Or c’est dans ce livre à la fois oublié et maudit, que Jall devait lire que le Dernier Sanctuaire – là encore situé à Eyralice
Mister L is offline   Reply With Quote
Old 04-16-2020, 05:57 PM   #628
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Mister L View Post
I want to find sets of em dashes with some text between them that are in the *same sentence*. So the text between the em dashes cannot include .!? but can include ,;: for example.
Did you mean sets of EN dashes instead? (Like your examples use?)

Something like this might work:

Find: –(\w*[^\.\?!]+?)–
Replace: —\1—

That would replace the en dashes with em dashes, and stick the captured "non-sentence" back in the middle.

I didn't do thorough testing though, so it probably would break in a lot of edge cases, but it did work correctly on your examples.
Tex2002ans is offline   Reply With Quote
Old 04-16-2020, 09:14 PM   #629
Mister L
Groupie
Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Posts: 159
Karma: 91148
Join Date: Jun 2010
Device: Sony 350
Quote:
Originally Posted by Tex2002ans View Post
Did you mean sets of EN dashes instead? (Like your examples use?)

Something like this might work:

Find: –(\w*[^\.\?!]+?)–
Replace: —\1—

That would replace the en dashes with em dashes, and stick the captured "non-sentence" back in the middle.

I didn't do thorough testing though, so it probably would break in a lot of edge cases, but it did work correctly on your examples.
Thank you! Yes sets of en dashes sorry for the typo. I don't need to replace the dashes, I need to replace the spaces actually (in French we use non-breaking spaces with dashes but depending where the dash is the space goes either in front or in back so you can't just do "replace all"), but the "not a sentence" part is what was giving me trouble. Some authors like to sprinkle those things around like there was no other punctuation and you can have multiple dashes in one paragraph and not all of them are sets. Now that I see the result I understand it but I don't think I would have come up with it on my own so it's a good thing I asked for help. This should save me quite a bit of time. Today I was working on a book that had over 400 dashes in it and that's not even the record so you can see why I'd want to optimise my searches.
Mister L is offline   Reply With Quote
Old 04-16-2020, 10:02 PM   #630
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Mister L View Post
Now that I see the result I understand it but I don't think I would have come up with it on my own so it's a good thing I asked for help. This should save me quite a bit of time. Today I was working on a book that had over 400 dashes in it and that's not even the record so you can see why I'd want to optimise my searches.
Definitely don't ever do a Replace All with something like that though, you won't know what sort of rogue madness might happen. (And I didn't test on an odd number of en dashes.)

Quote:
Originally Posted by Mister L View Post
I don't need to replace the dashes, I need to replace the spaces actually (in French we use non-breaking spaces with dashes but depending where the dash is the space goes either in front or in back so you can't just do "replace all"), but the "not a sentence" part is what was giving me trouble. Some authors like to sprinkle those things around like there was no other punctuation and you can have multiple dashes in one paragraph and not all of them are sets.
Find: – (\w*[^\.\?!]+?) –
Replace: –&nbsp;\1&nbsp;–

Hopefully it works, and it will at least save you a lot of time. The rest can probably then be found with a simple:

Find: – <--- Put a space before or after the en dash
Tex2002ans is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Examples of Subgroups emonti8384 Lounge 32 02-26-2011 06:00 PM
Accessories Pen examples Gunnerp245 enTourage Archive 15 02-21-2011 03:23 PM
Stylesheet examples? Skitzman69 Sigil 15 09-24-2010 08:24 PM
Examples kafkaesque1978 iRiver Story 1 07-26-2010 03:49 PM
Looking for examples of typos in eBooks Tonycole General Discussions 1 05-05-2010 04:23 AM


All times are GMT -4. The time now is 03:35 AM.


MobileRead.com is a privately owned, operated and funded community.