isUsername method

bool isUsername(
  1. String s
)

Checks if string is a valid username.

Implementation

bool isUsername(String s) => hasMatch(s, r'^[a-zA-Z0-9][a-zA-Z0-9_.]+[a-zA-Z0-9]$');