Skip to content

Commit 72b5257

Browse files
style: simplify regex expression
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 1570932 commit 72b5257

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dandischema/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
DANDI_DOI_PATTERN = (
8989
rf"^{_INNER_DANDI_DOI_PATTERN}$"
9090
if _INSTANCE_CONFIG.doi_prefix is not None
91-
else rf"^(?:{_INNER_DANDI_DOI_PATTERN})?$" # This matches an empty string as well
91+
else rf"^({_INNER_DANDI_DOI_PATTERN}|)$" # This matches an empty string as well
9292
)
9393
DANDI_PUBID_PATTERN = rf"^{ID_PATTERN}:{VERSION_PATTERN}$"
9494
DANDI_NSKEY = "dandi" # Namespace for DANDI ontology

0 commit comments

Comments
 (0)