use strict;
my $str = 'https://int.soccerway.com/national/czech-republic/czech-liga/20192020/championship-round/r54505/
https://int.soccerway.com/national/england/championship/20192020/regular-season/r53782/
https://int.soccerway.com/national/finland/veikkausliiga/2020/regular-season/r56520/
https://int.soccerway.com/national/germany/play-offs-12/20192020/s17666/
https://int.soccerway.com/national/germany/play-offs-23/20192020/s17670/
https://int.soccerway.com/national/norway/1-division/2020/regular-season/r56858/
https://int.soccerway.com/national/sweden/superettan/2020/s18293/
https://int.soccerway.com/national/united-states/nwsl-challenge-cup/2020/preliminary-round/r58293/
https://int.soccerway.com/national/czech-republic/czech-liga/20192020/championship-round/
https://int.soccerway.com/national/england/championship/20192020/regular-season/
https://int.soccerway.com/national/finland/veikkausliiga/2020/regular-season/
https://int.soccerway.com/national/germany/play-offs-12/20192020/
https://int.soccerway.com/national/germany/play-offs-23/20192020/
https://int.soccerway.com/national/norway/1-division/2020/regular-season/
https://int.soccerway.com/national/sweden/superettan/2020/
https://int.soccerway.com/national/united-states/nwsl-challenge-cup/2020/preliminary-round/';
my $regex = qr`(https?://\S+/)[^\s/]+/`mp;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html