3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php preg_match('#https?://(?:plus\.)?google\.com/\+?(\w+)#ui', 'https://plus.google.com/+ForeigñNáme/', $matches); var_dump($matches);
based on Y8SUB
Output for 5.3.4 - 7.1.0
array(2) { [0]=> string(38) "https://plus.google.com/+ForeigñNáme" [1]=> string(13) "ForeigñNáme" }
Output for 4.3.0 - 5.3.3
array(2) { [0]=> string(31) "https://plus.google.com/+Foreig" [1]=> string(6) "Foreig" }