<?php $text = 'метар TEXT текст-2'; if (preg_match('~метар\s+\S+~u', $text, $out)){ var_dump($out);}
Standard input is empty
array(1) { [0]=> string(15) "метар TEXT" }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!