|
|
#796 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,073
Karma: 6361556
Join Date: Nov 2009
Device: many
|
You can change the amount of context provided, but if you walk through things one by one anyway, you can easily pick out which instances to skip, and even edit the text directly to handle all cases you want. So I guess I do not understand the problem you are trying to solve if you already plan to walk things manually.
|
|
|
|
|
|
#797 | |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 507
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
Quote:
Last edited by ElMiko; 07-26-2025 at 10:22 PM. |
|
|
|
|
|
|
#798 |
|
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Sep 2025
Device: iPad
|
I'm using Sigil 2.6.0 and trying to match attributes like: epub:type="frontmatter titlepage" (where the value is variable.)
I expected Code:
epub:type="[^"]*" From what I can tell from the user guide, skimming this thread, and trying an online expression tester, it should work. What am I missing? |
|
|
|
|
|
#799 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,688
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Try... epub:type=".*?"
Do you need to capture and reuse the value? If yes, surround with brackets (.*?) |
|
|
|
|
|
#800 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,763
Karma: 24088559
Join Date: Dec 2010
Device: Kindle PW2
|
|
|
|
|
|
|
#801 |
|
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Sep 2025
Device: iPad
|
|
|
|
|
|
|
#802 |
|
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8
Karma: 591908
Join Date: Jun 2011
Device: Kindle
|
For a string of letters and numbers
([^>]+)(.*?) \w to match any single alphanumeric character: 0-9, a-z, A-Z, and _ (underscore) \s to match any single whitespace character. \d any single digit eg. use some text ([^>]+)(.*?) & something to end string of letters & numbers <a name="Chapter_LIII" id="Chapter_LIII"></a> <a([^>]+)(.*?)></a> |
|
|
|
|
|
#803 | |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 507
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
Quote:
If you try you set your replacement value to \2 (i.e. so that it references your (.*?) expression), you'll see that there's functionally a null replacement value. In otherwords, it's not actually matching anything. I would generally render your search as: Code:
<a[^>]*?></a> Or, in the event that there might be text in the hyperlink code such as <a name="Chapter_LIII" id="Chapter_LIII">SOME TEXT HERE</a>: Code:
<a[^>]*?>.*?</a> EDIT: I use * instead of +, but I'm fairly certain that in conjunction with the ? greedy quantifier, you could just as easily swap the * out for a + without affecting the search behavior. EDIT2: Sorry, just a point of clarification, the second regex example I used above will also match <a name="Chapter_LIII" id="Chapter_LIII"></a>. But if you ONLY wanted to match hyperlinks that have no display text, the first regex is the one you want. Last edited by ElMiko; 10-31-2025 at 10:22 PM. |
|
|
|
|
|
|
#804 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,271
Karma: 61916422
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Here is My find (just) Roman
Code:
<p class="\w">([CLXVI]{1,7})</p>
|
|
|
|
|
|
#805 | |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 507
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
Quote:
Code:
<p[^>]*?>([CLXVI]{1,7})</p>
Last edited by ElMiko; 11-01-2025 at 03:44 AM. |
|
|
|
|
|
|
#806 | |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,271
Karma: 61916422
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
L.E, Modesitt pushes the count frequently
|
|
|
|
|
|
|
#807 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 507
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
@theducks, you know, now that I think about it some more, I'm wondering if the upper range on the quantifier is necessary at all. Since there are no other permitted characters (including spaces)—except potentially "Chapter"—and I don't think there are any words that are composed exclusively of any combination of those 5 letters and that wouldn't already be capture by the existing {1,8} range (e.g. "ILL" or "CIVIL"), it seems the quantifier isn't actually limiting any false positives that {1,} would erroneously include.
What do you think? |
|
|
|
|
|
#808 | |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,271
Karma: 61916422
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
|
|
|
|
|
|
|
#809 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 507
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
|
|
|
|
|
|
#810 | |
|
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,397
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
|
Quote:
388 = CCCLXXXVIII 389 = CCCLXXXIX 390 = CCCXC 399 = CCCXCIX 400 = CD In the case of 388 you would need 11 characters. The only books I know of with chapters that get that high are the web serials that get broken down into individual books when published to Amazon....
Last edited by Turtle91; 11-02-2025 at 02:27 PM. |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Examples of Subgroups | emonti8384 | Lounge | 32 | 02-26-2011 07:00 PM |
| Accessories Pen examples | Gunnerp245 | enTourage Archive | 15 | 02-21-2011 04:23 PM |
| Stylesheet examples? | Skitzman69 | Sigil | 15 | 09-24-2010 09:24 PM |
| Examples | kafkaesque1978 | iRiver Story | 1 | 07-26-2010 04:49 PM |
| Looking for examples of typos in eBooks | Tonycole | General Discussions | 1 | 05-05-2010 05:23 AM |