Determine if a string is contained within another string - Javascript RegExp

Javascript examples for RegExp:RegExp test

Description

Determine if a string is contained within another 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">
    window.onload=( function() {/*from  w w  w.  j  av  a2s. c o  m*/

var htmlstr = '<b class="fl_r">Example</b>';
var reg =  /<b class="fl_r">Example<\/b>/.test(htmlstr);
console.log(reg)

    });

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

Related Tutorials