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