In the following code, I have used RegExp to check E with Case Sensitive Modifier i in the string The best things in life are free. But it is returning true even if there is no uppercase E in the string.
<html>
<body>
<script type="text/javascript">
var patt1=new RegExp("E","i");
document.write(patt1.test("The best things in life are free"));
</script>
</body>
</html>
falsebecause there is no uppercaseEin the stringThe best things in life are free