Repository: aws-cloudformation/cfn-lint

Issue:
v1: false-positive for `E3024`
### CloudFormation Lint Version

cfn-lint 1.3.0

### What operating system are you using?

Windows 11

### Describe the bug

After updating from `v0.87.7` to `v1.3.0` i noticed a new finding, which is a false-positive:

```yaml
  SecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: "Security Group"
      VpcId: !ImportValue VPC1-VPC-ID
      Tags:
        - Key: Name
          Value: 'SecurityGroup\'
```

```sh
[cfn-lint] E3024: 'SecurityGroup\\' does not match '^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$'
```

### Expected behavior

cfn-lint does not provide this false-positive finding. I think the regex might be wrong, but regex is not my speciality.

### Reproduction template

```yaml
AWSTemplateFormatVersion: 2010-09-09
Description: Test

Resources:
  SecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: "Security Group"
      VpcId: !ImportValue VPC1-VPC-ID
      Tags:
        - Key: Name
          Value: 'SecurityGroup\'
```


Discussion:

Patch:
diff --git a/src/cfnlint/data/schemas/other/resources/tagging.json b/src/cfnlint/data/schemas/other/resources/tagging.json
index f8dafc2ca2..846f98bd49 100644
--- a/src/cfnlint/data/schemas/other/resources/tagging.json
+++ b/src/cfnlint/data/schemas/other/resources/tagging.json
@@ -7,11 +7,10 @@
      "Key": {
       "maxLength": 128,
       "minLength": 1,
-      "pattern": "^(?!aws:)([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"
+      "pattern": "^(?!aws:).+$"
      },
      "Value": {
-      "maxLength": 256,
-      "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"
+      "maxLength": 256
      }
     },
     "required": [
@@ -20,9 +19,8 @@
     "type": "object"
    },
    "patternProperties": {
-    "^(?!aws:)([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$": {
-     "maxLength": 256,
-     "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"
+    "^(?!aws:).+$": {
+     "maxLength": 256
     }
    },
    "properties": {},


Test patch:
diff --git a/test/unit/rules/resources/properties/test_tagging.py b/test/unit/rules/resources/properties/test_tagging.py
index e49198ae0b..73acaad248 100644
--- a/test/unit/rules/resources/properties/test_tagging.py
+++ b/test/unit/rules/resources/properties/test_tagging.py
@@ -50,19 +50,16 @@ def rule():
             ],
         ),
         (
-            "Bad special characters in array",
+            "Value is too long",
             {
                 "Tags": [
-                    {"Key": "Foo", "Value": "Foo & Bar"},
+                    {"Key": "Foo", "Value": "a" * 257},
                 ]
             },
             {"taggable": True},
             [
                 ValidationError(
-                    (
-                        "'Foo & Bar' does not match "
-                        "'^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$'"
-                    ),
+                    f"{'a'*257!r} is longer than 256",
                     path=deque(["Tags", 0, "Value"]),
                     schema_path=deque(
                         [
@@ -71,7 +68,7 @@ def rule():
                             "items",
                             "properties",
                             "Value",
-                            "pattern",
+                            "maxLength",
                         ]
                     ),
                     validator="tagging",
@@ -79,25 +76,22 @@ def rule():
             ],
         ),
         (
-            "Bad special characters in object",
+            "Value is too long in object",
             {
-                "Tags": {"Foo": "Foo ! Bar"},
+                "Tags": {"Foo": "a" * 257},
             },
             {"taggable": True},
             [
                 ValidationError(
-                    (
-                        "'Foo ! Bar' does not match "
-                        "'^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$'"
-                    ),
+                    f"{'a'*257!r} is longer than 256",
                     path=deque(["Tags", "Foo"]),
                     schema_path=deque(
                         [
                             "properties",
                             "Tags",
                             "patternProperties",
-                            "^(?!aws:)([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$",
-                            "pattern",
+                            "^(?!aws:).+$",
+                            "maxLength",
                         ]
                     ),
                     validator="tagging",
@@ -114,10 +108,7 @@ def rule():
             {"taggable": True},
             [
                 ValidationError(
-                    (
-                        "'aws:Foo' does not match "
-                        "'^(?!aws:)([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$'"
-                    ),
+                    ("'aws:Foo' does not match " "'^(?!aws:).+$'"),
                     path=deque(["Tags", 0, "Key"]),
                     schema_path=deque(
                         ["properties", "Tags", "items", "properties", "Key", "pattern"]
@@ -137,7 +128,7 @@ def rule():
                     (
                         "'aws:Foo' does not match any of "
                         "the regexes: "
-                        "'^(?!aws:)([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-@]*)$'"
+                        "'^(?!aws:).+$'"
                     ),
                     path=deque(["Tags", "aws:Foo"]),
                     schema_path=deque(["properties", "Tags", "additionalProperties"]),