Skip to main content

validate_doi

Function validate_doi 

Source
pub fn validate_doi(doi: &str) -> bool
Expand description

Validate a DOI string against the standard format: 10.NNNN…/suffix.

  • Prefix: 10. followed by 4–9 digits (registrant code).
  • Separator: /.
  • Suffix: one or more valid characters ([a-zA-Z0-9-._;()/:]+).

The input is normalized (trimmed, URL-prefix-stripped) before validation.