From e7a9528f4fcf53e58fae4d4c2ddc7e400900bc56 Mon Sep 17 00:00:00 2001 From: Jaykumar Gosar Date: Mon, 14 Feb 2022 11:51:30 -0800 Subject: [PATCH] Add note about escaping backslash in pattern trait --- docs/source/1.0/spec/core/constraint-traits.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/source/1.0/spec/core/constraint-traits.rst b/docs/source/1.0/spec/core/constraint-traits.rst index ccab72f826f..9a7aecc20f5 100644 --- a/docs/source/1.0/spec/core/constraint-traits.rst +++ b/docs/source/1.0/spec/core/constraint-traits.rst @@ -427,6 +427,12 @@ languages. string matches the regular expression, whereas ``@pattern("^\\w+$")`` requires that the entire string matches the regular expression. +.. note:: + + Pattern values that contain ``\`` need to :ref:`escape it `. + For example, the regular expression ``^\w+$`` would be specified as + ``@pattern("^\\w+$")``. + .. tabs:: .. code-tab:: smithy