3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "New York Marriott Marquis, New York, NY, USA", "New York,# Marriott, Marquis,& New York, NY, USA,", "$$$^^^&&&&&&,&&&&&########New York, NY, USA" ]; $re = '/^(?!(?:.*[*|\":<>[\]{}`\()\';@&$,]){4}).+$/'; foreach ($strings as $string) { preg_match($re, $string, $matches); var_dump($matches); }

preferences:
25.01 ms | 405 KiB | 5 Q