You are here: PSPad forum > English discussion forum > 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
Posted by: maki | Date: 2020-03-15 15:48 | IP: IP Logged
Simple:
1-1
1/1
Maybe
(\d+[-/]\d+)
Edited 1 time(s). Last edit at 2020-03-15 15:51 by maki.
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/
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.
Posted by: maki | Date: 2020-03-16 11:25 | IP: IP Logged
I've improved the match to the links.
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-]+)+
Editor PSPad - freeware editor, © 2001 - 2025 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR