我需要检查一个字符串是否匹配这个特定的模式。
模式是:
(数字)(允许所有字符)(数字)
并且数字可能有逗号(“。”或“,”)!
例如,输入可以是500+400或400,021+213.443。
500+400
400,021+213.443
我试过了Pattern.matches("[0-9],?.?+[0-9],?.?+", theequation2),但是没有用!
Pattern.matches("[0-9],?.?+[0-9],?.?+", theequation2)
我知道我必须使用方法 Pattern.match(regex, String),但我无法找到正确的正则表达式。
拉莫斯之舞
12345678_0001
相关分类