use strict;
my $str = '\'가락시장(340)\',
\'가락시장(8)\',
\'가산디지털단지(7)\',
\'강남(222)\',
\'강남구청\',
\'강동\',
\'강동구청\',
\'강변(214)\',
\'개롱\',
\'개화산\',
\'거여\',
\'건대입구(212)\',
\'건대입구(7)\',
\'경복궁(317)\',
\'경찰병원(341)\',
\'고덕\',
\'고려대\',
\'고속터미널(329)\',
\'고속터미널(7)\',
\'공덕(5)\',
\'공덕(6)\',
\'공릉\',
\'광나루\',';
my $regex = qr/'([\p{L}]+)/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