<?php $pattern = '/\bПривіт\W+(?:\w+\W+){0,6}?світу\b/ui'; $sample = 'Привіт, світу!'; echo (int)preg_match( $pattern, $sample, $matches).PHP_EOL; print_r($matches);
You have javascript disabled. You will not be able to edit any code.