# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ This module provides functions for validating input from various sources. """ import re def is_valid_rid(text): """ Client supplied request IDs must conform to the pattern of IDs generated by API Gateway (e.g. 26a07142-098a-4bea-b67d-1fe5a098bf29) """ pattern = re.compile('\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12}') return pattern.match(text)