- package com.heima.regex;
- public class Demo1_Regex {
- public static void main(String[] args) {
- System.out.println(checkQQ("012345"));
- System.out.println(checkQQ("a1b345"));
- System.out.println(checkQQ("123456"));
- System.out.println(checkQQ("1234567890987654321"));
-
- String regex = "[1-9]\\d{4,14}";
- System.out.println("2553868".matches(regex));
- System.out.println("012345".matches(regex));
- System.out.println("2553868abc".matches(regex));
- }
|
|