![]() |
#781 |
Member
![]() Posts: 14
Karma: 10
Join Date: Aug 2023
Device: Kobo Forma
|
Good evening, Haudek,
Got it. Problem solved. Thanks for everything. |
![]() |
![]() |
![]() |
#782 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 450
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
Is there a way to match numbers that are between repeated characters?
For example to match the numbers in: Code:
<p class="lorem">.........6.........</p> <p class="lorem">____8___</p> <p class="lorem">----------3-------</p> Code:
<p.*?>[_-\]*?\K[0-9](?=[_-\]*?</p>) Code:
<p class="lorem">_._--__8..----</p> Code:
<p class="lorem">****8***</p> |
![]() |
![]() |
![]() |
#783 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#784 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 450
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
One of the things I'm trying to solve for is when I don't know what the repeating character is, only that it is repeating. It could be a period or a hyphen or the letter "a"... literally anything (except a number).
Last edited by ElMiko; 03-27-2025 at 09:45 PM. |
![]() |
![]() |
![]() |
#785 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#786 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 450
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
Quote:
Code:
<p class="lorem">_._--__8..----</p> |
|
![]() |
![]() |
![]() |
#787 | |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24
Karma: 111614
Join Date: Mar 2025
Location: Poland
Device: Kindle Voyage
|
Quote:
Code:
<p[^>]*>.*?(.).*?\d+.*?\1.*?</p> |
|
![]() |
![]() |
![]() |
#788 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 450
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
I almost considered apologizing in advance for the convoluted question, but better late than never: sorry, everybody! I realize this is a little tricky to understand
Let's say i have the following <p> elements: Code:
1. <p class="lorem">....1...</p> 2. <p class="lorem">----2---</p> 3. <p class="lorem">___3_____</p> 4. <p class="lorem">_._--__4..----</p> 5. <p class="lorem">aaa5aaaa</p> That is to say, I'm looking to match a <p> element where the number is nested withing any string of repeating characters, and then isolate the number for reuse in a replacement function @Haudek - I think we're getting close, although i don't think I see any backreference in the first half of the regex... EDIT1 — SOLVED: Thanks, Haudek. Your regex got the ball rolling. I'd forgotten that backreferencing works within the search field (not merely in the replace field). Code:
<p[^>]*>(.)\1*?([0-9]+)\1*?</p> Last edited by ElMiko; 03-28-2025 at 09:45 AM. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |