$re = '/^(?:(?!^\s|[ \-\']{2}|[\d\r\n\t\f\v!"#$%&()*+,\.\/:;<=>?@[\\\\\]^_`{|}~€‚ƒ„…†‡ˆ‰‹‘’“”•–—˜™›¡¢£¤¥¦§¨©ª«¬®¯°±²³´¶·¸¹º»¼½¾¿×÷№′″ⁿ⁺⁰‱₁₂₃₄]|\s$).){1,50}$/m';
$str = 'Regex matches: from 1 to 50 international letters separated by single delimiter ( -\')
Regex rejects: empty prefix/suffix, consecutive delimiters ( -\'), digits, new line, tab, limited list of extended ASCII characters
Jo Nesbø
Pedro Almodóvar
بيدرو ألمودوبار
Sofija Jogailaitė
Akira Kurosawa
Куросава Акіра
Куросава Акира
黒澤明
黑澤明
আকিৰা কুৰোছাৱা
Tyue\' Tgshh
CxCx5C5C
AKIRA KUROSAWA
Akir@ Kursawa
Stev3 Smith
STeve Smith
Steve SMith
Steve Sm1th
Steve G. Smith
d\'Are to Beaware
Hyoung Kyoung Wu
Mike O\'Neal
Steve Johnson-Smith
Jozef-Schmozev Hiemdel
O Henry Smith
Mathais d\'Arras
Martin Luther King Jr
Downtown-James Brown
Darren McCarty
An Ni
O. Henry McCarty
George De FunkMaster
Kurtis B-Ball
Ahmad el Jeffe
John Smith
\'John Smith';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php