M
M
MaksymPerehinka2017-05-04 15:26:01
PHP
MaksymPerehinka, 2017-05-04 15:26:01

How can I fix the regular expression so that it correctly searches for a link in the text that comes after this link?

Hello friends, please help me to complete the regular expression.
The task is this:
Given a page www.region.ru/raskrytie-informatsii/region-develop...
My task is to parse the URI of a link to a file from the "Calculation of the size of own funds" tab, knowing the date of the file's publication.
I wrote a regular expression, but it does not select the link closest to the publication date, but the first link in the tab.
Regular: "#class="rasschetSredstv".*<td>.*href="(?P<URL>.*)".*(?P<DATE>15.03.\d\d\d\d).* </td>#Ums"
Below is a screenshot of the $matches array
5a1c7e2e64b14a638d9da0da789367d1.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2017-05-04
@MaksymPerehinka

https://regex101.com/r/8JjzGT/1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question