$re = '/^[\wàáâäãåąčćęèéêëėįìíîïłńòóôöõøùúûüųūÿýżźñçčšžÀÁÂÄÃÅĄĆČĖĘÈÉÊËÌÍÎÏĮŁŃÒÓÔÖÕØÙÚÛÜŲŪŸÝŻŹÑßÇŒÆČŠŽ∂ð\']{6,20}$/m';
$str = 'Válidas
AaaaaaaaBCCcc654_qq
1111s123AaBCcc654_qq
____ds4___xx
12345_123
-Inválidas.
asdmkk45hjsiwehsnasp21
12345-123 (tem hífen)
asdkdn 092834sdfdf (tem espaco em branco)
$123.0 (tem "$" e ".")';
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