vibe.d beta banner
get vibe.d
0.10.1

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

Function validateIdent

Validates an identifier string as used in most programming languages.

string validateIdent (
  string str,
  string additional_chars = "_",
  string entity_name = "An identifier",
  bool no_number_start = true
);

bool validateIdent(R) (
  ref R error_sink,
  string str,
  string additional_chars = "_",
  string entity_name = "An identifier",
  bool no_number_start = true
)
if (isOutputRange!(R, char));

The identifier must begin with a letter or with any of the additional_chars and may contain only ASCII letters and digits and any of the additional_chars.

Invalid identifiers 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.