<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h1>Regular Expression i</h1>
<button onclick="fun_regexgno();">No i Regular Expression</button>
<button onclick="fun_regexgi()">i Regular Expression</button>
<script>
var str = "WELCOME";
//i=> case-insensitive
function fun_regexgi()
{
alert(str.replace(/w/i, "#"));
}
//without using 'i'
function fun_regexgno()
{
alert(str.replace(/w/, "#"));
}
</script>
</body>
</html>
Regular expressions i :- genius student
Reviewed by Network security
on
October 27, 2019
Rating:

No comments: