The page tests how to extract the file name and the various parts of that to produce pagination:

Full URL is: https://brisray.com/TEST/page5.htm

Filename is: page5.htm
First part is page5
Second part is htm
Numbers only are 5
Text only is page

Now use the above information to produce the links:

Pagination:

FirstPrevious123456789101112NextLast

Now use CSS on the links: