Javascript examples for RegExp:Bracket
Do a global search for the character-span from uppercase "A" to uppercase "E":
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w w w. j a v a 2 s .c om*/ var str = "The following CODE shows HOE to !"; var patt1 = /[A-E]/g; var result = str.match(patt1); document.getElementById("demo").innerHTML = result; } </script> </body> </html>