Thread: Regex examples
View Single Post
Old 03-17-2025, 04:09 AM   #767
Pavulon
Member
Pavulon began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Aug 2023
Device: Kobo Forma
Use of the quantifier "?"

In automatic translation:
Good morning,
I have two identical construction links except for the presence of a class.

<a href="anchor5" id="note5">5</a>

<a class="backlink" href="anchor6" id="noted">6</a>

In Regex 101, I manage to select the two links using the quantifier "?" on the class group.

<a (class="backlink")? href="(.*?)" id="(.*?)">([0-9] {1,4})</a>

In Sigil, it does not work, I only recover the link with the class. I also tried with the quantifier "*", without better result.
Does anyone know how to tell me?
Thanks.
Pavulon is offline   Reply With Quote