View Single Post
Old 04-15-2021, 08:56 AM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,648
Karma: 205022288
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by vijer View Post
Found the answer.

(<a id=\"page)(.*:?)(\"></a>)
What's the colon for?
Code:
(.*:?)
Are there really optional colons in the page number that need to be accounted for?

I'd probably use something like:

Code:
<a id="page\d+"></a>
or

Code:
<a id="page[^>]+"></a>
It's probably not an issue here, but (.*?) is quite greedy and can cause problems when trying to search html. [^>]* or [^>]+ are typically safer if you need to match multiple unknown characters but need to guarantee it never spans multiple tags.
DiapDealer is offline   Reply With Quote