Get value between 2 character within a string - Javascript jQuery

Javascript examples for jQuery:String

Description

Get value between 2 character within a string

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){/*from  w  w  w  .  j  a  va  2 s .  co  m*/
$(document).ready(function() {
  var value = "2015-11-30_1112_3";
  var value1 = value.match(/_(.+)_/g);
  console.log(value1);
});
    });

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

Related Tutorials