看板 Perl 關於我們 聯絡資訊
: 這樣可以得到串列@file : 但是如果一串文字: this is a test. just "test". : ↓ ↓↓ ↓ ↓ ↓ : 若只想取 this is a test just test : 這樣該怎麼做呢 my $str = 'this is a test. just "test".'; my @file = $str =~ /(\w+)/g; foreach(@file) { print $_,$/; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.114.71.40
jb0802:感謝~~可是如果像一些有prime的縮寫字don't can't tom's 12/20 15:30
jb0802:那這樣要怎麼解決 12/20 15:31
LiloHuang:my @file = $str =~ /([\w']+)/g; 12/20 15:41