I need a regular expression that accepts only Greek chars and spaces for a name field in my form (PHP). I've tried several findings on the net but no luck. Any help will be appreciated.
Full letters solution, with accented letters:
/^[A-Za-zΑ-Ωα-ωίϊΐόάέύϋΰήώ]+$/
I'm not too current on the Greek alphabet, but if you wanted to do this with the Roman alphabet, you would do this:
/^[a-zA-Z\s]*$/
So to do this with Greek, you replace a
and z
with the first and last letters of the Greek alphabet. If I remember right, those are α
and ω
. So the code would be:
/^[α-ωΑ-Ω\s]*$/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With