SHARE
TWEET

Untitled

a guest Jun 27th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. String validateUsername(String value) {
  2.  String pattern = r'^(([^<>()[]\.,;:s@"]+(.[^<>()[]\.,;:s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$';
  3. RegExp regExp = new RegExp(pattern);
  4. if (value.length == 0) {
  5.   return "Username is Required";
  6. } else if(!regExp.hasMatch(value)){
  7.   return "Invalid username";
  8. }else {
  9.   return null;
  10. }
  11.      
  12. TextField(
  13.      inputFormatters: [
  14.           BlacklistingTextInputFormatter(
  15.             new RegExp("[^a-z^A-Z^0-9]+")) //Regex for accepting only alphanumeric characters
  16.           ],
  17. )
  18.      
  19. SELECT * FROM user WHERE user_name = "userName";
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top