I have a long link that looks like this:
link = 'http://....rech_cod_cat=1&rech_cod_rub=&rech_cod_typ=&rech_cod_sou_typ=&rech_cod_pay=TN&rech_cod_reg=&rech_cod_vil=&rech_cod_loc=&rech_prix_min=&rech_prix_max=&rech_surf_min=&rech_surf_max=&rech_age=&rech_photo=&rech_typ_cli=&rech_order_by=31&rech_page_num=829'
I am trying to match the integer at the end to find the number of the last page, my first idea was this :
m = re.search(r'num=(\d)+$', link)
but this only matches the last digit, I pulled the + inside the match group just to try it
m = re.search(r'num=(\d +)$', link)
and now it works but I have no idea why. Shouldn't both pattern match the same group ? Can someone explain how these two differ ? I am also confused as why it matched the last digit and not the first if it was going to match only one digit.