synapse-react-client
Version:
[](https://travis-ci.com/Sage-Bionetworks/Synapse-React-Client) [](https://badge.fury.io/js/synaps
21 lines • 784 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SYNAPSE_ENTITY_ID_REGEX = exports.DOI_REGEX = void 0;
// doi regex here - https://www.crossref.org/blog/dois-and-matching-regular-expressions/
// note - had to add an escape character for the second and third forward slash in the regex above
exports.DOI_REGEX = /^10.\d{4,9}\/[-._;()\/:a-z0-9]+$/i;
/**
* Checks for a Synapse ID, with or without a version number.
* Captures the synId and version number into capture groups.
*
* Usage examples:
* > const result = 'syn123.9'.match(SYNAPSE_ENTITY_ID_REGEX)
* > result[0]
* 'syn123.9'
* > result[1]
* 'syn123'
* > result[2]
* '9'
*/
exports.SYNAPSE_ENTITY_ID_REGEX = /^(syn\d+)(?:\.(\d+))?$/;
//# sourceMappingURL=RegularExpressions.js.map