diff --git a/doc/src/sgml/ref/create_domain.sgml b/doc/src/sgml/ref/create_domain.sgml
index b07f571c79..89b51aa76d 100644
--- a/doc/src/sgml/ref/create_domain.sgml
+++ b/doc/src/sgml/ref/create_domain.sgml
@@ -1,5 +1,5 @@
@@ -167,8 +167,8 @@ where constraint is:
CREATE DOMAIN us_postal_code AS TEXT
CHECK(
- VALUE ~ '^\d{5}$'
-OR VALUE ~ '^\d{5}-\d{4}$'
+ VALUE ~ '^\\d{5}$'
+OR VALUE ~ '^\\d{5}-\\d{4}$'
);
CREATE TABLE us_snail_addy (