作者jb0802 (james)
看板Perl
标题[问题] 有关正规表示式
时间Thu Dec 20 13:38:04 2007
想取出英文单字 \w
但不知道该怎麽打正规表示式
while(<>)
{
chomp($_);
$_=~ tr/A-Z/a-z/;
@temp = split(/\s+/,$_);
push (@file,@temp);
}
这样可以得到串列@file
但是如果一串文字: this is a test. just "test".
↓ ↓↓ ↓ ↓ ↓
若只想取 this is a test just test
这样该怎麽做呢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.118.155.150