作者superlubu (叔叔你人真好)
看板java
標題Re: [問題] java.util.regex.Pattern
時間Mon Oct 29 23:16:44 2012
※ 引述《coolcomm (coolcomm)》之銘言:
: → coolcomm:http://ppt.cc/pPN8 還是不懂 再貼一張圖/_\ 10/29 19:55
Matcher m = Pattern.compile("\\d*").matcher("akr84w");
int cnt = 0;
while (m.find()) {
System.out.println(cnt++ + " (" + m.start() + " - " + m.end() + "):" +
m.group() );
}
請看看是什麼 output.....
*, +, ? 的分別要清楚啊....
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.102.70.209
※ 編輯: superlubu 來自: 218.102.70.209 (10/29 23:27)
1F:推 coolcomm:小弟終於脫離地獄了 感謝感謝m(_ _)m 10/30 03:27