Last active
January 26, 2022 15:06
-
-
Save sportebois/ab6d00106bd27c08204f4880060a221d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file: app/dry_demo_01.py | |
import re | |
# The urn pattern describe a workspace, and a resource id | |
# Examples: | |
# drn:23f742:bc4b57dd0bec433198a58cd36b6c7ee8 | |
# (drn for Demo Resource Name, or random identifier for demo purposes) | |
drn_pattern = r"^drn:[a-z0-9]{6}:[a-f0-9]{32}$" | |
def is_valid_project_drn(urn: str) -> bool: | |
return re.match(drn_pattern, urn, re.ASCII) is not None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment