vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function validateUserName

Validates a user name string.

string validateUserName (
  string str,
  int min_length = 3,
  int max_length = 32,
  string additional_chars = "-_",
  bool no_number_start = true
);

bool validateUserName(R) (
  ref R error_sink,
  string str,
  int min_length = 3,
  int max_length = 32,
  string additional_chars = "-_",
  bool no_number_start = true
)
if (isOutputRange!(R, char));

User names may only contain ASCII letters and digits or any of the specified additional letters.

Invalid user names will cause an exception with the error description to be thrown.

Authors

Sönke Ludwig

Copyright

© 2012-2014 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.