swift-identifiers is not maintained anymore.
A work-in-progress Swift library for handling and extracting scholarly identifiers from text.
Current version: Unreleased Supported Swift versions: 3.0x
import Identifiers
// Extracting from a larger text element
let dois = DOI.extract("I love 10.1234/foobar and 10.1234/bazquux")
// Instantiating with a literal string
// (failures are assumed to be developer error)
let doi = DOI("10.1234/foobar")
// Instantiating from a variable
do {
let doi = try DOI("10.1234/bazquux")
} catch(let error) {
// throws an IdentifierError.invalidIdentifier
}
We also maintain a version of this library for Ruby and for PHP.
A further version for Rust is currently in development.
Copyright © 2017 Altmetric LLP.
Distributed under the MIT License.