Use Regular Expression match letter and digit in javascript - Javascript RegExp

Javascript examples for RegExp:RegExp Match

Description

Use Regular Expression match letter and digit in javascript

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <style id="compiled-css" type="text/css">

body {font-family: "Courier New"; font-size: 12px;}


      </style> 
      <script type="text/javascript">
    window.onload=function(){/*from w w w  .  ja v a2  s. co m*/
var str = "SUM([A2:A10],[B2:B10],[C2:C10],[D2:D10])";
var matches = str.match(/\[[A-Z0-9:]+\]/g);
document.body.innerHTML = matches.join("<br>");
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials