# Regular Expressions

{% hint style="info" %}
These fields are used for the ***Identifier Schema*** record type onl&#x79;*.*&#x20;
{% endhint %}

FAIRsharing records for identifier schemas include two distinct regular expression (regex) fields to support consistent validation and matching across systems.

The **regular expression** field captures the '*canonical' identifier string* — that is, the identifier as defined by its schema specification, independent of any transport mechanism, resolver URL, or display formatting. This regex should match only the intrinsic identifier syntax governed by the issuing Authority. For example, for DOIs this would match the DOI name beginning with `10.` (e.g. `10.1234/abcd`), not the resolver form `https://doi.org/10.1234/abcd`.&#x20;

The **secondary regular expressions** field allows additional patterns that match commonly encountered, non-canonical representations of the same identifier. These may include resolver URLs (e.g. `https://doi.org/10.1234/abcd`), legacy resolver domains, URN forms, or other widely used serialisations. These patterns exist to support identifier recognition in real-world data, where identifiers frequently appear embedded in URLs or prefixed forms. Alternative regexes should not redefine the identifier syntax itself; rather, they provide practical matching support while preserving the authoritative schema definition expressed in the primary regex.

Maintaining this separation also supports consistent evaluation of Globally Unique, Persistent, and Resolvable Identifier Schemas ([GUPRI](/fairsharing/record-sections-and-fields/general-information/globally-unique-persistent-and-resolvable-identifier-schemas.md)), by distinguishing intrinsic identifier structure from resolver infrastructure. See our [community alignment](/fairsharing/alignment-with-community-efforts.md#identifier-schemas) and [GUPRI pages](/fairsharing/record-sections-and-fields/general-information/globally-unique-persistent-and-resolvable-identifier-schemas.md) for more information about other identifier schema properties.

The community can use our API to identify which id schema(s) a particular identifier string belongs to.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fairsharing.gitbook.io/fairsharing/additional-information/regular-expressions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
