isGreek property
bool?
isGreek
Checks if the String has only Greek characters.
Example
String foo = 'this is a τεστ';
bool isLatin = foo.isGreek; // returns false
String foo2 = 'Τα αγαθά κόποις κτώνται';
bool isLatin2 = foo2.isGreek; // returns true
Implementation
bool? get isGreek {
if (this == null) {
return null;
}
if (this!.isEmpty) {
return null;
}
return RegExp(r'^[α-ωΑ-ΩίϊΐόάέύϋΰήώΊΪΌΆΈΎΫΉΏ\s]+$').hasMatch(this!);
}