Re: [問題] 有關正規表示式

看板Perl作者 (相見不如懷念)時間17年前 (2007/12/20 13:44), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串2/3 (看更多)
: 這樣可以得到串列@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

12/20 15:30, , 1F
感謝~~可是如果像一些有prime的縮寫字don't can't tom's
12/20 15:30, 1F

12/20 15:31, , 2F
那這樣要怎麼解決
12/20 15:31, 2F

12/20 15:41, , 3F
my @file = $str =~ /([\w']+)/g;
12/20 15:41, 3F
文章代碼(AID): #17QW5OjM (Perl)
討論串 (同標題文章)
文章代碼(AID): #17QW5OjM (Perl)