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
To elaborate on leo pal's answer, an even more complete regex, which would accept even capital accented Greek characters, would be the following:
/^[α-ωΑ-ΩίϊΐόάέύϋΰήώΊΪΌΆΈΎΫΉΏ\s]+$/
With this, you get:
α-ω
- lowercase lettersΑ-Ω
- uppercase lettersίϊΐόάέύϋΰήώ
- lowercase letters with all (modern) diacriticsΊΪΌΆΈΎΫΉΏ
- uppercase letters with all (modern) diacritics\s
- any whitespace characterNote: The above does not take into account ancient Greek diacritics (ᾶ, ἀ, etc.).