精簡扼要的 Perl 課程講義(六):常規表達式(Regular Expression) - G. T. Wang
使比對到的資料越短越好, # 此時 Perl 所比對的結果是:'That' " That is a cat, not a hat. " =~ / T.*? at /; # [] ... # 取代 Hello 成 Bill print; # Hello Bill. $_ = " Hello World. \n "; $word = " World "; s/ $word / Bill /; # 可內嵌變數 print; # (2) 使用 ......