Re: [請問] Ant Renamer的regexp問題(解答篇)

看板EZsoft (小軟體)作者 (cralvin)時間8年前 (2017/02/26 16:06), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
23_0023_24.jpg -> 023_023_024.jpg input0014@1234@3.jpg -> input014@1234@003.jpg 18_0018.jpg -> 018_018.jpg regexp版有位大大解出來了,是用//g Global matching The final two modifiers we will discuss here, //g and //c , concern multiple matches. The modifier //g stands for global matching and allows the matching operator to match within a string as many times as possible. In scalar context, successive invocations against a string will have //g jump from match to match, keeping track of position in the string as it goes along. You can get or set the position with the pos() function. 這樣寫能處理上面三行,ant rename不能下//g、不過好像內建…… <Regexp Expr="(\d+)" Repl="00$1"/> <Regexp Expr="0*(\d*)(\d{3})" Repl="$1$2"/> -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.236.88.23 ※ 文章網址: https://www.ptt.cc/bbs/EZsoft/M.1488096370.A.CA0.html

02/26 20:12, , 1F
原來應該要這樣解...
02/26 20:12, 1F
文章代碼(AID): #1OienooW (EZsoft)
文章代碼(AID): #1OienooW (EZsoft)