js 字符串匹配

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>W3Cschool教程(w3cschool.cn)</title>
</head>
<body>

<script>
var str = "Visit W3Cschool";
var patt1 = /w3cschool/i;
document.write(str.match(patt1));
</script>

</body>
</html>

猜你喜欢

转载自www.cnblogs.com/sea-stream/p/10259136.html