在下面的例子中,我们将查看正则表达式是否具有标志 i:
<script type="text/javascript">
var str = "Visit W3School";
var patt1 = new RegExp("W3");
if(patt1.ignoreCase
)
{
alert("ignoreCase property is set");
}
else
{
alert("ignoreCase property is NOT set.");
}
</script>