Three Char Month and Culture matching using regex - Javascript RegExp

Javascript examples for RegExp:RegExp Match

Description

Three Char Month and Culture matching using regex

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*ww  w .  java 2 s. c o m*/
var shouldMatch = "may";
var regexPattern = /^Jan$|^Feb$|^Mar$|^Apr$|^May$|^Jun$|^Jul$|^Aug$|^Sep$|^Oct$|^Nov$|^Dec$/i;
if(regexPattern.test(shouldMatch)) {
    console.log(shouldMatch);
}
    }

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

Related Tutorials