username validation fix

This commit is contained in:
2024-11-30 01:46:20 +02:00
parent 199b8ab08c
commit 7bb745268d
4 changed files with 16 additions and 13 deletions

View File

@@ -214,8 +214,7 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
}
bool isUsernameValid(String username) {
return RegExp(r'^(?=[a-zA-Z0-9._]{8,20}$)(?!.*[_.]{2})[^_.].*[^_.]$')
.hasMatch(username);
return RegExp(r'^[a-zA-Z][a-zA-Z0-9_]{5,19}$').hasMatch(username);
}
Future<void> submitForm() async {