use strict;
my $str = '10:11く⑥你的萬寧官方網店訂單已確認 - 2105351889く萬寧 mannings你的訂單已確認 -2105351889Ruby Wong 你好,感謝你於萬寧官方網店購物。我們會盡快處理你的訂單,以下是你的訂單詳情:訂單編號2105351889訂購日期2024年6月3日收貨地址:香港九龍紅磡高山道9號恒山閣4樓 403室送貨詳情:訂單狀態:訂單處理中預計送貨日期:2-5個工作天(以收到短訊/電郵日期為準)[請留意]所有送貨日期和時間均為預計的。當閣下的訂單和送貨獲得確認後,閣下將會收到我們有關實際送貨安排的事先通知。萬寧將保留因應實際貨存而修改訂單內容之權利。產品售價Abbotf雅培金装加營素方便即飲裝雲呢拿味$518.00(原箱)250毫升×24罐171496數量4金額$1,761.20金裝加營素即飲裝原箱85折運費:訂單總額:vuu ID:免費$1,761.20
';
my $regex = qr/(?:單([^\d\$])+)/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