|
@@ -0,0 +1,51 @@
|
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
|
+<html lang="en">
|
|
|
|
|
+
|
|
|
|
|
+<head>
|
|
|
|
|
+ <meta charset="UTF-8">
|
|
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
+ <title>Document</title>
|
|
|
|
|
+</head>
|
|
|
|
|
+
|
|
|
|
|
+<body>
|
|
|
|
|
+ <script>
|
|
|
|
|
+ // const reg = /[abc]/;
|
|
|
|
|
+ // console.log(reg.test('aababa'));
|
|
|
|
|
+ // console.log(reg.test('abc'));
|
|
|
|
|
+ // console.log(reg.test('acb'));
|
|
|
|
|
+ // console.log(reg.test('bcbcbc'));
|
|
|
|
|
+ // console.log(reg.test('acac'));
|
|
|
|
|
+ // console.log(reg.test('acbds'));
|
|
|
|
|
+
|
|
|
|
|
+ // const reg1 = /[0-9]/;
|
|
|
|
|
+ // const reg2 = /[a-z]/;
|
|
|
|
|
+ // const reg3 = /[A-Z]/;
|
|
|
|
|
+
|
|
|
|
|
+ // // 匹配[0-9a-zA-Z]中的任意一个字符
|
|
|
|
|
+ // const reg4 = /\W/
|
|
|
|
|
+ // console.log(reg4.test('C'));
|
|
|
|
|
+
|
|
|
|
|
+ // const reg5 = /./;
|
|
|
|
|
+ // console.log(reg5.test('C'));
|
|
|
|
|
+ // console.log(reg5.test('\n'));
|
|
|
|
|
+ // console.log(reg5.test('\r'));
|
|
|
|
|
+ // console.log(reg5.test('\t'));
|
|
|
|
|
+ // console.log(reg5.test(' '));
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // const reg6 = /\D/;
|
|
|
|
|
+ // console.log(reg6.test('C'));
|
|
|
|
|
+ // console.log(reg6.test('1'));
|
|
|
|
|
+ // console.log(reg6.test(' '));
|
|
|
|
|
+
|
|
|
|
|
+ const reg7 = /\S/;
|
|
|
|
|
+ console.log(reg7.test('C'));
|
|
|
|
|
+ console.log(reg7.test('1'));
|
|
|
|
|
+ console.log(reg7.test(' '));
|
|
|
|
|
+ console.log(reg7.test('\n'));
|
|
|
|
|
+ console.log(reg7.test('\r'));
|
|
|
|
|
+ console.log(reg7.test('\t'));
|
|
|
|
|
+ </script>
|
|
|
|
|
+</body>
|
|
|
|
|
+
|
|
|
|
|
+</html>
|