看板 Perl 關於我們 聯絡資訊
※ 引述《notbigdeal (Not a Big deal)》之銘言: : 想請問一下, 我將整篇文章1一行行讀入之後. : 凡是遇到chapter 的地方, 後面num要加1 的話, 最簡潔的寫法是什麼? : 我本來有想要這樣寫 $_ =~ s/chapter \d/chapter ++$num/ : 但這樣寫法並不行, 我又不想拆成兩三行寫, 請問有沒有高手可以教一下 s/chapter (\d+)/"chapter ".($1+1)/eg; -- Errors,like straws,upon the surface flow; He who would search for pearls must dive below. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.244.211
plusjung:請問一下..倒數後面的第二個e是幹嘛的 推 218.160.54.184 05/11