Case-insensitive Flag - Regex

Demonstrate the case-insensitive flag using test() and match() methods.

HTML

<h4>/^[a-z]+$/i</h4>

<div></div>
<div></div>
<div></div>
<div></div>

CSS

body { font-family: arial, sans-serif; }
div {padding: 10px 0px;}

JavaScript

var regex = new XRegExp("^\\p{L}*$")
var a = "abcäöüéèê"
if (regex.test(a)) {
    console.log("1");
} else {
    console.log("2");
}