zheng 18 uur geleden
bovenliggende
commit
9752b37d3b
1 gewijzigde bestanden met toevoegingen van 42 en 0 verwijderingen
  1. 42 0
      12.正则/1.正则.html

+ 42 - 0
12.正则/1.正则.html

@@ -0,0 +1,42 @@
+<!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>
+    <!-- 正则表达式
+        const 名称 = /需要校验的规则/ 
+        修饰符:
+        g 匹配全局
+        i 不区分大小写
+    -->
+    <script>
+        const reg = /aa/gi;
+        const str = 'AA,四大名著有aa,我也爱看Aa'
+        console.log(reg.test('xxxxxx'));
+        console.log(reg.exec(str));
+        console.log(str.match(reg))
+        const res = str.replace(reg, '红楼梦');
+        console.log(res);
+
+        /**
+         * js数据类型
+         * 基本:string boolean number undefined null symbol bigInt
+         * 引用:Object(对象 数组 函数)
+         * 怎么去判断数据类型
+         * typeof
+         * instanceof
+         * Object.prototype.toString.call()
+         * constructor
+         * 盒模型
+         * 数组的方法 那些会改变原数组 那些不会改变原数组
+         * for in / for of
+         * /
+    </script>
+</body>
+
+</html>