2020-04-02 正则表达式

2020-04-02  本文已影响0人  很菜的花椰菜

https://www.jianshu.com/p/b24e5ae9e9ac

https://deerchao.cn/tutorials/regex/regex.htm

看一下这个,小数点后 几位 

https://blog.csdn.net/u012468263/article/details/50621779/

String pattern = "(([1-9]{1}\\d*)|(0{1}))(\\.\\d{2})?";

        System.out.println("0.2  >  "+("0.2".matches(pattern)));

        System.out.println("07.23  >  "+("07.23".matches(pattern)));

        System.out.println("7.23  >  "+("07.23".matches(pattern)));

        System.out.println("123.58  >  "+("123.58".matches(pattern)));

        System.out.println("123.589  >  "+("123.589".matches(pattern)));

https://zhidao.baidu.com/question/426858151178186572.html

https://www.cnblogs.com/zery/p/3438845.html

上一篇下一篇

猜你喜欢

热点阅读