Find a pdf page number in a list of strings

You can refer to this post for a solution: