fork download
  1. <?php
  2.  
  3. $srch = "žvolen";
  4. $srch = preg_quote($srch);
  5. if (preg_match('/\w$/u', $srch)) {
  6. $srch .= '\\b';
  7. }
  8.  
  9. if (preg_match('/^\w/u', $srch)) {
  10. $srch = '\\b' . $srch;
  11. }
  12. echo $srch . PHP_EOL;
  13. echo preg_match("/" . $srch . "/ui", "žvolen is used.");
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
\bžvolen\b
1