To match words bread, read, or red : Match : Regular Expressions JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Regular Expressions » Match »

 

To match words bread, read, or red

















<html>
<SCRIPT LANGUAGE='JavaScript'>
<!--
var sToMatch = "bread, bed bead sead sea";
var reBreadReadOrRed = /b?rea?d/;
alert(reBreadReadOrRed.test(sToMatch))

    //-->
</SCRIPT>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Regular Expressions
» Match