Reputation: 1442
My code:
if( preg_match( '/^[a-zA-Z0-9,.!? ]*$/', '.,!? a ' ) ) {
echo 'contains numbers, dot, coma, whitespace or latin letters<br/>'
}
But would be false if contains žы
.
This
if ( preg_match("/^\p{L}+$/u", 'žы') ) {
echo 'Contains any letters<br/>';
}
How to combine both, so that allow any letters (also non latin), numbers, dot, coma, whitespace?
Upvotes: 1
Views: 54