The built-in function Fn::MatchPattern checks whether a value of the String type matches the condition in a regular expression. If the value matches the condition, true is returned. Otherwise, false is returned.
Declaration
JSON
{ "Fn::MatchPattern": [ pattern, value ] }YAML
Syntax for the full function name:
Fn::MatchPattern: pattern, valueSyntax for the short form:
!MatchPattern [pattern, value]
Parameters
pattern: Required. This parameter specifies a regular expression that is of the String type.value: Required. This parameter specifies the value that you want to use to match the condition in the specified regular expression.
Return value
true or false.
Examples
Fn::MatchPattern: - '[a-z]+' - adbIn this example,
trueis returned.Fn::MatchPattern: - '[a-z]+' - 12bIn this example,
falseis returned.