bagaimana menghindari karakter khusus di validator
// alphanumeric
static final validCharacters = RegExp(r'^[a-zA-Z0-9]+$');
// alphanumeric and &%=
static final validCharacters = RegExp(r'^[a-zA-Z0-9&%=]+$');
void main() {
final validCharacters = RegExp(r'^[a-zA-Z0-9_\-=@,\.;]+$');
print(validCharacters.hasMatch('abc123'));
}
Tiny Coders