<?php $str = 'Синее. Море'; preg_match('/^\w+/u', $str, $match);var_dump($match);die('end');
Standard input is empty
array(1) { [0]=> string(10) "Синее" } end
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!