All Products
Search
Document Center

Resource Orchestration Service:Fn::MatchPattern

Last Updated:Jun 17, 2026

Fn::MatchPattern checks whether a string value matches a regular expression and returns true or false.

Declaration

  • JSON

    {
      "Fn::MatchPattern": [
        pattern,
        value
      ]
    }
  • YAML

    • Syntax for the full function name:

      Fn::MatchPattern: pattern, value
    • Syntax for the short form:

      !MatchPattern [pattern, value]

Parameters

  • pattern: Required. A regular expression of the String type.

  • value: Required. The string value to match against the regular expression.

Return value

true or false.

Examples

  • Fn::MatchPattern:
     - '[a-z]+'
     - adb

    true is returned.

  • Fn::MatchPattern:
     - '[a-z]+'
     - 12b

    false is returned.