java正则表达式提取字符串中的数字
生活随笔
收集整理的這篇文章主要介紹了
java正则表达式提取字符串中的数字
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
http://stackoverflow.com/questions/2367381/extract-numbers-from-a-string-java
?
Pattern p = Pattern.compile(\\d+);
使用這個會有空字符串出現
?
Pattern p = Pattern.compile("-?\\d+");
這是OK,
轉載于:https://www.cnblogs.com/pengxinglove/p/4476634.html
總結
以上是生活随笔為你收集整理的java正则表达式提取字符串中的数字的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ::selection
- 下一篇: 问题总结2015/05/05