forked from HaoZhang95/Python24
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic03.html
More file actions
38 lines (28 loc) · 1.02 KB
/
Copy pathbasic03.html
File metadata and controls
38 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="../../12jQuery_Basic/day01/js/jquery-1.12.4.min.js"></script>
<script>
$(function () {
// 正则表达式的使用new RegExp(规则, 正则的目标参数),开发中不常用这种new的方式
function func1() {
var reg01 = /a/i // 忽略大小写的字母
var reg02 = /a/ // 只能包含小写字母
var str1 = "abc"
var str2 = "ABc"
// 使用reg的test方法来检测参数是否符合当前的reg
console.log(reg01.test(str1));
console.log(reg02.test(str2));
}
func1()
})
</script>
</head>
<body>
</body>
</html>