3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = "Faktura č.: XYZ"; preg_match("~^\\s*Faktura\\s+č.:\\s*(?P<invoice>\S+)(?:\\s+za\\s+období\\s+0?(?P<month>\\d{1,2})\\s*/\\s*(?P<year>\\d{4}))?\\s*$~iu", $str, $matches); var_dump($matches);
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
array(3) { [0]=> string(16) "Faktura č.: XYZ" ["invoice"]=> string(3) "XYZ" [1]=> string(3) "XYZ" }