Perl——正則表達式(四) 查找替換s///

一. 介紹 使用 s/regex/replacement/modifiers 進行查找替換spa 二. 實例 (1) s///code $f = "'quoted words'"; #進行模式匹配,下面方法去除''單引號 if($f =~ s/^'(.*)'$/$1/) { #true, $1指的是引用了第一組(.*)的內容, ^$這兩個字符用來表示開始與結束 print "matches",
相關文章
相關標籤/搜索