Saturday, March 19, 2011

RegExp in JavaScript

 <script type="text/javascript">  
 var str = "mastertablemastertext";  
 var patt1 = /master/i;  
//i is modifier for case-insensitive and g for Global search
 alert(str.match(patt1));  
 </script>  

No comments: