Skip to content

regex_search in validation #892

Discussion options

You must be logged in to vote

So, I figured it out. Here is an example:

resource_name:
  type: str
  help: The name of your custom resource?
  validator: >-
    {% if not (resource_name | regex_search('^Custom::[A-Z][a-zA-Z0-9]+$')) %}
    Must be a CloudFormation custom type name, eg Custom::Custom.
    {% endif %}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@yajo
Comment options

yajo Dec 16, 2022
Maintainer

@mvanholsteijn
Comment options

Answer selected by yajo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants