You are here: PSPad forum > English discussion forum > Re: Problem Extract URL

Re: Problem Extract URL

Goto Page: Previous1 2 3

#21 Re: Problem Extract URL

Posted by: pspad | Date: 2020-03-15 15:28 | IP: IP Logged

Put several real examples include examples what didn't match

Options: Reply | Quote | Up ^


#22 Re: Problem Extract URL

Posted by: maki | Date: 2020-03-15 15:48 | IP: IP Logged

Simple:

1-1
1/1

Maybe smiling smiley

(\d+[-/]\d+)

Edited 1 time(s). Last edit at 2020-03-15 15:51 by maki.

Options: Reply | Quote | Up ^


#23 Re: Problem Extract URL

Posted by: pspad | Date: 2020-03-15 15:54 | IP: IP Logged

([/\d-]+)+

This will act for

1-1
1/1
as well as for
1-1/111/1/1-1/1111111/

Options: Reply | Quote | Up ^


#24 Re: Problem Extract URL

Posted by: maki | Date: 2020-03-15 15:54 | IP: IP Logged

After repeated attempts, it finally works regex:

\.ru/([^/]+)/([^/]+)/(\d+[-/]\d+)|\.ru/avtor(/[a-zA-Z0-9-]+)+

Edited 1 time(s). Last edit at 2020-03-15 15:55 by maki.

Options: Reply | Quote | Up ^


#25 Re: Problem Extract URL

Posted by: maki | Date: 2020-03-16 11:25 | IP: IP Logged

I've improved the match to the links. smiling smiley
Surely it will find only the right links in any text.

YEAR Range 2000-2020
MONTH Range 01-12

\.ru/(20[01][0-9]|2020)/0*([1-9]|1[0-2])/(\d+[-/]\d+)|\.ru/avtor(/[a-zA-Z0-9-]+)+

Options: Reply | Quote | Up ^


Goto Page: Previous1 2 3





Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR