我的字符串值;
09:00-10:00,12:00-14:30,16:00-18:00(这个字符串像这样重复时间间隔n次)
我想使用模式匹配找出字符串的格式是否正确;
Pattern.matches("<Pattern Here>", stringValue);
Run Code Online (Sandbox Code Playgroud)
是否可以?
我试过;
Pattern.matches("^[0-9:0-9-0-9:0-9,]+$", value);
Run Code Online (Sandbox Code Playgroud)
但无法正常工作