Find substring between angle brackets with custom regex match function - Javascript RegExp

Javascript examples for RegExp:RegExp Match

Description

Find substring between angle brackets with custom regex match function

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(){/*  w w  w.j a  va 2 s. c o  m*/
var matches = [];
'abc <abc@gmail.com>, def <def@gmail.com>'.replace(/\<(.*?)\>/g, function(_, match){
  matches.push(match);
});
console.log(matches.join(','));
    }

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

Related Tutorials