regex判断数字

news/2024/7/4 0:47:06 标签: regex, string, class
class="baidu_pl">
class="article_content clearfix">
class="htmledit_views"> public class Test {
    public static void main(String[] args) {
        String a = "-1";
         Pattern p = Pattern.compile("[0-9]*|-[0-9]*");
         Matcher m = p.matcher(a);
         boolean b = m.matches();
         System.out.println(b);
    }
}
判断是否是多个整数或负数

http://www.niftyadmin.cn/n/1140722.html

相关文章

ln: operation not permitted

ln: operation not permitted 在挂载的磁盘上建立软链接提示没有操作权限 例如: ln -s aa bb1ln:aa operation not permitted-------------------------------------------------------------------------------- 原因是: 挂载的磁盘是fat32分区格式&…

jdk1.5兼容1.4编译

javac -source 1.4 -target 1.4

测试SD卡读写速度

执行测试命令之前,一定先清除缓存:# echo 3> /proc/sys/vm/drop_caches SD卡读取的速度# echo 3> /proc/sys/vm/drop_caches # time dd if/dev/mmcblk0 of/dev/null bs1M count500 convsync 5000 records in5000 records out524288000 bytes (524…

LWP::UserAgent的用法

LWP::UserAgent是一个模拟用户浏览器的类,在使用的时候需要遵守以下几步: 1、引入模块 2、创建一个LWP::UserAgent的对象 3、设置这个对象的相关参数 4、创建HTTP::Request实例 5、发送请求 6、返回HTTP::Response对象。 1、引入模块 use LWP::UserAgent…

四舍五入 double数据 两位小数

/*** 四舍五入 double数据 两位小数* param d * return*/public static double doubleRound(double d) {BigDecimal bd new BigDecimal(String.valueOf(d));bd bd.setScale(2,RoundingMode.HALF_UP);return bd.doubleValue();}

我在iText封装的方法,从某个pdf文件中获得指定的页

查了一堆资料,终于从2on1这个例子中有所启示,根据这个改造的方法。 import java.io.File;import java.io.FileOutputStream;import java.io.IOException; import com.lowagie.text.Document;import com.lowagie.text.DocumentException;import com.low…

交叉编译python2.7.7

一、python下载网址: http://www.python.org/ftp/python/ 二、python的交叉编译依赖openssl ,openssl的下载网址: https://www.openssl.org/source/old/ 三、编译:1、交叉编译 openssl-1.0.2g # /home/sw/openssh/openssl-1.0.2g …

一个简单的小问题的解决:类图中线变成直的,不能斜了

选中线,菜单Format->Line Style->Oblique/Toggle 即可