Thread: Regex examples
View Single Post
Old 01-20-2021, 12:19 AM   #685
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,552
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by davidfor View Post
The "|" is basically an "or". Your regex is basically search for matches to one of:

Code:
<a id="Page_([xvi]+)
Code:
([\d]+)" class="x-ebookmaker-pageno" title="\[([xvi]+)
Code:
([\d]+)\]"></a>
I think you want:

Code:
<a id="Page_([xvi]+|[\d]+)" class="x-ebookmaker-pageno" title="\[([xvi]+|[\d]+)\]"><\/a>
The two groups are the page number and title in either of the formats.
Sorry, somehow I missed your reply (or maybe I forgot that I read it, also quite likely), so this is a belated thanks.
hobnail is offline   Reply With Quote