<html>
<body>
$str = "Apples and bananas.";
$pattern = "/ba(na){2}/i";
echo preg_match($pattern, $str);
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_regex_grouping by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:22:24 GMT -->
</html>