http://www.perlmonks.org?node_id=1012897


in reply to match the urls

#!/usr/bin/perl use strict; use warnings; my @array = ('https://www.abc.com/ap/ap/top-news/76/nTk3M/','https://w +ww.abc.com/videos/news/eye-catching/vmxJr','https://www.abc.com/ap/to +p/45/state-politic al-news/fgdfgd', 'https://www.abc.com/ap/ap/top-news/', 'https://www.a +bc.com/'); my @b = grep {$_ =~ /\w+\:\/\/\w+\.\w+\.\w+\/(\w+\-?\w+?\/){3,}./ } @a +rray; print "@b";