Do a global, case-insensitive search for the character-span that's NOT [a-s]: - Javascript RegExp

Javascript examples for RegExp:Bracket

Description

Do a global, case-insensitive search for the character-span that's NOT [a-s]:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {//from   w  w  w  .  ja  v  a  2  s . c o  m
    var str = "The following code shows how to ";
    var patt1 = /[^a-s]/gi;
    var result = str.match(patt1);
    document.getElementById("demo").innerHTML= result;
}
</script>

</body>
</html>

Related Tutorials