use strict;
my $str = 'http://11st.co.kr
http://www.11st.co.kr
http://auction.co.kr
http://blog.naver.com/wef
http://blog.daum.net/wef
http://bj.afreecatv.com/wef
http://cafe.daum.net
http://cafe.naver.com/
http://smartstore.naver.com
http://smartstore.naver.com/wef
storefarm.naver.com
http://partner.booking.naver.com/bizes
http://shop.naver.com/starkrobotics
http://sell.storefarm.naver.com
https://www.rndia.or.kr/
http://m.hakjum.com/
itskorea.kr
minishop.gmarket.co.kr
hrd.keia.kr
www.dsf.go.kr';
my $regex = qr/(http[s]?:\/\/)?(www.)?(11st|auction|bj\.afreecatv|blog\.naver|blog\.daum|cafe\.daum|cafe\.naver|smartstore\.naver|storefarm\.naver|partner\.booking.naver\.com|partner\.booking\=.naver|shop\.naver\.com|gmarket|go\.kr).*/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