<?php $re = '/(.*?)текст(.*)/iu'; $str = 'ТекстТЕКСТТексТ'; preg_match_all($re, $str, $matches, PREG_SET_ORDER);print_r($matches);
Standard input is empty
Array ( [0] => Array ( [0] => Текст [1] => [2] => ) [1] => Array ( [0] => ТЕКСТ [1] => [2] => ) [2] => Array ( [0] => ТексТ [1] => [2] => ) )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!