Reputation: 183
The only allowed one format English or Devanagari.
Example:
string="abhijit अभिजित"
How to check combination of English and Devanagari letters with the help of regex pattern?
Upvotes: 0
Views: 816
Reputation: 183
After long time i have added my own regex pattern and my problem is solved
Please try this solution ...
Definitely save your valuable time
//here check combination of English and Devanagari letters
static String namePattern = "(?=.*[a-z])(?=.*[A-Z])(?=.*[\u0900-\u097F])";
//Pass your name in this method
static bool isNameValid(String name) {
if (name.isEmpty) {
return false;
} else {
RegExp nameExp = RegExp(Regex.namePattern , caseSensitive: false, multiLine: false);
return nameExp.hasMatch(input.trim());
}
}
Upvotes: 2