Use RegExp to find all occurences of a a quoted word in an array - Javascript jQuery

Javascript examples for jQuery:Array

Description

Use RegExp to find all occurences of a a quoted word in an array

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://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
   </head> 
   <body> 
      <script type="text/javascript">
var testsentence = 'This "is" a wonderful "sentence" to "test" "stuff"';
console.log(testsentence.match(/"[^"]+"/g));

      </script>  
   </body>/*from w  w  w .  j av a 2 s.  c o m*/
</html>

Related Tutorials