Skip to content

Instantly share code, notes, and snippets.

@sportebois
Last active January 26, 2022 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sportebois/ab6d00106bd27c08204f4880060a221d to your computer and use it in GitHub Desktop.
Save sportebois/ab6d00106bd27c08204f4880060a221d to your computer and use it in GitHub Desktop.
# 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