[問題] java.util.regex.Pattern

看板java作者 (coolcomm)時間11年前 (2012/10/29 11:52), 編輯推噓0(004)
留言4則, 2人參與, 最新討論串1/3 (看更多)
http://ppt.cc/ZbBl 24: int number=Integer.parseInt(Pattern.compile("\\d*").matcher(capacity).group()); 請問為什麼每次到了第24行就會拋出IllegalStateException? 剛剛把這行分開來寫 結果更奇怪了 Pattern pattern=Pattern.compile("\\d*"); //在這行就拋出IllegalStateException 有人知道是發生什麼事嗎@@ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.99.36.152

10/29 13:39, , 1F
可以貼出全部 Exception 訊息嗎? 我試跑沒事
10/29 13:39, 1F

10/29 13:50, , 2F
只試跑 -> Pattern pattern = ... 這句沒事
10/29 13:50, 2F

10/29 13:54, , 3F
我只覺得,應該是 regEX 寫錯了吧?
10/29 13:54, 3F

10/29 19:55, , 4F
http://ppt.cc/pPN8 還是不懂 再貼一張圖/_\
10/29 19:55, 4F
文章代碼(AID): #1GZVrXJ3 (java)
文章代碼(AID): #1GZVrXJ3 (java)