1
做替代我在它如何檢查|在Perl中
"[email protected] | firstname | lastname"
我想用不同的值來代替| lastname
具有下列數據的字符串。如果我使用s/
進行替換,那麼我需要做些什麼?讓它認識。如果我做
$foo =~ s/ lastname/fillertext/;
它工作正常。但如果我做
$foo =~ s/ | lastname/fillertext/;
它不起作用。我試圖做 - \|/ lastname
,"| lastname"
,'| lastname'
。
可能重複http://stackoverflow.com/questions/576435 /怎麼辦,我把手 - 特殊字符 - 在-A-Perl的正則表達式) – daxim 2011-05-04 07:36:31