<?php

$srch = "žvolen";
$srch = preg_quote($srch);
if (preg_match('/\w$/u', $srch)) {
	$srch .= '\\b';   
}

if (preg_match('/^\w/u', $srch)) {
	$srch = '\\b' . $srch;
}
echo $srch . PHP_EOL;
echo preg_match("/" . $srch . "/ui", "žvolen is used.");