Thread: Regex examples
View Single Post
Old 10-12-2020, 07:36 PM   #678
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,591
Karma: 14328510
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by BeckyEbook View Post
Use:
Code:
<a id="Page_([xvi]+|\d+)" class="x-ebookmaker-pageno" title="\[([xvi]+|\d+)\]"></a>
Thanks, that worked, as did theducks' answer (with the added square brackets for the title).


Removing the parentheses from the first part so that it's


Page_[xvi]+|\d+


also works (although no capture to reuse for the title).
(I thought it worked the first time I tried it but just now it did not.)

So why did my extra parentheses screw it up?


I added the parentheses so that it was clear, to me at least, what the OR was for.

Last edited by hobnail; 10-12-2020 at 07:56 PM.
hobnail is offline   Reply With Quote