|  10-07-2023, 06:18 PM | #751 | 
| Sigil Developer            Posts: 9,070 Karma: 6361556 Join Date: Nov 2009 Device: many | 
			
			Then something must be broken with Minimal Match.  I will look into it.
		 | 
|   |   | 
|  10-07-2023, 08:53 PM | #752 | 
| Grand Sorcerer            Posts: 28,880 Karma: 207000000 Join Date: Jan 2010 Device: Nexus 7, Kindle Fire HD | 
			
			In my experience Minimal Match is working. It's just that the ? in an expression has the ability to negate/reverse the Minimal Match Setting (and vice-versa). Consider the following content: Code: <p>This is a para.</p> <p>This is a para.</p> <p>This is a para.</p> <p>This is a para.</p> <p>This is a para.</p> Code: <p>.*</p> Code: <p>.*?</p> But this is where it gets tricky. If you leave the expression the same (<p>.*?</p>) and check Minimal Match, the search will then actually become greedy. If you remove the ? from the expression, and leave Minimal Match checked, the results will be non-greedy again. Sigil's regex has always worked this way to my knowledge. So you have to be careful combining Minimal Match and ?. I've always used one or the other, but very rarely both both at the same time for that very reason. In short: Using both Minimal Match and "?" can make an expression greedy. You can also put my original content on one line and eliminate the dotAll option from the equation. Code: <p>This is a para.</p><p>This is a para.</p><p>This is a para.</p><p>This is a para.</p><p>This is a para.</p> Last edited by DiapDealer; 10-07-2023 at 09:00 PM. | 
|   |   | 
|  10-07-2023, 09:20 PM | #753 | 
| Sigil Developer            Posts: 9,070 Karma: 6361556 Join Date: Nov 2009 Device: many | 
			
			Thanks!  That makes sense and saves me from having to dive into the regex search code once again!
		 | 
|   |   | 
|  10-07-2023, 09:34 PM | #754 | 
| Grand Sorcerer            Posts: 28,880 Karma: 207000000 Join Date: Jan 2010 Device: Nexus 7, Kindle Fire HD | 
			
			No problem. It's come up from time to time. Leaving dotall unchecked can muddy these waters too. When working on pretty printed p tag stuff, it can lead people to believe their expression is less greedy than it really is. When in fact '.*' is just stopping at line breaks. | 
|   |   | 
|  12-25-2023, 05:15 AM | #755 | 
| Member  Posts: 12 Karma: 10 Join Date: Dec 2020 Device: Android | 
			
			Is it possible to do multiple replacement with Sigil regex? For example, i want to replace the following:- qw=er as=df zx=cv I can search them with qw|as|zx But i don't know how to replace them respectively. The list for replacement is long, and i need to search & replace them for every book, replacing one by one is too troublesome so i am looking for multiple replacement method. Thanks | 
|   |   | 
|  12-25-2023, 06:26 AM | #756 | |
| Wizard            Posts: 2,306 Karma: 13057279 Join Date: Jul 2012 Device: Kobo Forma, Nook | Quote: 
 
 What you'll want to do is create a "Group", then insert all your Search/Replaces underneath that. That will allow you to run a whole giant list of Search/Replaces in a single button push if you wanted to. I explained how back in: | |
|   |   | 
|  12-25-2023, 07:13 AM | #757 | 
| Member  Posts: 12 Karma: 10 Join Date: Dec 2020 Device: Android | |
|   |   | 
|  12-25-2023, 07:25 AM | #758 | 
| Member  Posts: 12 Karma: 10 Join Date: Dec 2020 Device: Android | 
			
			Back to saved searches in group, is there a way to disable one or few of the long entries before execution?
		 | 
|   |   | 
|  12-25-2023, 07:45 AM | #759 | 
| Sigil Developer            Posts: 9,070 Karma: 6361556 Join Date: Nov 2009 Device: many | 
			
			You can create multiple subgroups and only run the subgroups you want in your longer saved search group.  Or temporarily delete or drag out the few searches you do not want to use, then don't save any changes at the end.
		 | 
|   |   | 
|  12-25-2023, 09:48 AM | #760 | 
| A Hairy Wizard            Posts: 3,395 Karma: 20212733 Join Date: Dec 2012 Location: Charleston, SC today Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire | 
			
			You need to highlight the group title you want to run. Also, a little quirk, if you want to run the same group multiple times you need to select a different line and then reselect the group title.
		 | 
|   |   | 
|  12-25-2023, 11:47 AM | #761 | 
| Sigil Developer            Posts: 9,070 Karma: 6361556 Join Date: Nov 2009 Device: many | 
			
			You can also select any set of contiguous searches and run them.
		 | 
|   |   | 
|  02-13-2024, 07:21 PM | #762 | 
| Groupie            Posts: 179 Karma: 91148 Join Date: Jun 2010 Device: Sony 350 | 
			
			I am not sure whether this is possible just with regex, I've found some regex + javascript solutions but I don't know how to do that. I'm hoping to make some kind of system for inserting a pagebreak marker at pre-determined intervals to make a page-list in books which have no paper equivalent. My idea is, using regex, count X number of characters (including spaces, but text only, no code), and insert a marker after each set, which I can then turn into a properly numbered and formatted epub3 pagebreak. So for instance, every 1490-1500 characters, insert the marker <span class="pbk" /> (or whatever). Ideally, I want to avoid inserting it inside words or inside any html code, but it can go between words or between paragraphs. Ideal results: (1498 characters)word <span class="pbk" />next word. OK (1500 characters)</p><span class="pbk" /><p> OK (1500 characters)<span class="pbk" /></p><p> OK (1500 characters)</p><p><span class="pbk" /> OK Undesirable results: (1499 characters)<<span class="pbk" />/p><p> AVOID (1498 characters)wo<span class="pbk" />rd AVOID IF POSSIBLE If there is no way to exclude mid-word insertions I will figure something out but I definitely want to avoid insertions inside html tags. I tried: search ((.){20,25}) replace \1<span class="pbk" /> Search options: No regex options selected Text only (I was using smaller numbers to make it easier to test), but for some reason it does not exclude the code. I also tried this, hoping to avoid mid-word insertions: ((\w|\s){20,25}\s|\w+\s|$) But it seems to select only one word + space, regardless of character count, and it excludes punctuation (including apostrophes). If this is not possible by regex, is it the kind of thing that could be added as a feature, where the number of characters per "page" could be user-defined? Alternately, if there is any easier way to make digital-only pagebreaks that I haven't heard about I am all ears. Thanks in advance if anyone has any ideas. | 
|   |   | 
|  02-13-2024, 09:42 PM | #763 | 
| Sigil Developer            Posts: 9,070 Karma: 6361556 Join Date: Nov 2009 Device: many | 
			
			There is a Sigil, Plugin called "Regex Function Replace", that should be able to count either characters or words of just text and even set the spans with incremented labels and ids with the right python function block. That may be the easiest way to do what you want. | 
|   |   | 
|  02-14-2024, 03:57 AM | #764 | 
| Grand Sorcerer            Posts: 5,763 Karma: 24088559 Join Date: Dec 2010 Device: Kindle PW2 | 
			
			There's a dedicated tool for this task that you might find helpful. Print Page Approximator for EPUB and EPUB3 (The author is an MR member.) If you happen to have a Kindle, the Calibre KFX output plugin also supports auto-generated page numbers. | 
|   |   | 
|  02-14-2024, 12:15 PM | #765 | ||
| Groupie            Posts: 179 Karma: 91148 Join Date: Jun 2010 Device: Sony 350 | Quote: 
 Quote: 
  I will take a look at both of those options.   | ||
|   |   | 
|  | 
| 
 | 
|  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 |