Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

how to avoid special characters in 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'));
}
 
PREVIOUS NEXT
Tagged: #avoid #special #characters #validator
ADD COMMENT
Topic
Name
6+9 =