作者vernc (cralvin)
看板Perl
標題Re: [請問] Ant Renamer的regexp問題?
時間Tue Feb 14 19:06:17 2017
23_0023_24.jpg -> 023_023_024.jpg
input0014@
[email protected] -> input014@
[email protected]
<Regexp Expr="(\D*)(\d\.)" Repl="$1\0\0$2"/>
<Regexp Expr="^(\D*)(\d\d\.)" Repl="$1\0$2"/>
<Regexp Expr="^(\D*)0+(\d\d\d\.)" Repl="$1$2"/>
本來是用上面三行,但只能處理單一組數字
想做到如上處理複數的效果
想像那三行要同一個rule,在任何情況下都適用
如上面那二行都是三組數字,想在n組數字下都通用
請問這要怎下?
thx
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.173.175.178
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Perl/M.1487070379.A.7E4.html
※ 編輯: vernc (1.173.175.178), 02/15/2017 01:49:17
※ 編輯: vernc (1.173.175.178), 02/15/2017 02:02:09
1F:→ herculus6502: g選項 02/15 09:46
2F:→ vernc: 上面何解? 02/15 18:59