MCPcopy Create free account
hub / github.com/DuGuQiuBai/Java / main

Method main

day14/code/day14_Regex/src/cn/itcast_02/RegexDemo.java:11–34  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

9 */
10public class RegexDemo {
11 public static void main(String[] args) {
12 /*
13 * ����У��绰����
14 *
15 * ������
16 * �绰��������
17 * 13812345678
18 * 13999998888
19 * 13123456789
20 * 18912345678
21 * 18811112222
22 */
23 //�������
24 String regex = "1[38][0-9]{9}";
25
26 //����¼���ֻ�����
27 Scanner sc = new Scanner(System.in);
28 System.out.println("�������ֻ����룺");
29 String phone = sc.nextLine();
30
31 //�����жϹ���
32 boolean flag = phone.matches(regex);
33 System.out.println(flag);
34 }
35}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected