Thread: Regex examples
View Single Post
Old 04-09-2022, 04:46 AM   #713
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 80,138
Karma: 148951761
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Ashjuk View Post
This is why I find REGEX so confusing.

When I was searching various REGEX sites for the code I could not find a clear answer, and it appears from your replies there are numerous ways of achieving the same result.

Becky - "[A-Fa-f0-9-]+"
theducks - ".+?"
BillPearl - "([^>]+)(.*?)"
JSWolf - "(.*)"
and
DiapDealer - "[^"]+"

I only tried Becky's solution, which worked perfectly, but I assume all the above would have achieved the same result.

So I'm now even more confused. My poor septuagenarian brain is never going to cope

But thanks to everyone for their suggestions - I have noted them all for future reference.
When the id I want to get rid of is in the format of id="ch1", I use id="ch[0-9]+" That gets rid of the chapter based ids.
JSWolf is offline   Reply With Quote