From 3143628859ac3f3eac1bb0b25e1a96e89fc3880e Mon Sep 17 00:00:00 2001 From: Jack Matthews Date: Mon, 22 Apr 2024 21:08:41 +1000 Subject: [PATCH] #patch: Fixes #165 - regex not working with headers and JSON snapshots --- .../src/main/java/au/com/origin/snapshots/Snapshot.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-snapshot-testing-core/src/main/java/au/com/origin/snapshots/Snapshot.java b/java-snapshot-testing-core/src/main/java/au/com/origin/snapshots/Snapshot.java index a132c2e..3857b1a 100644 --- a/java-snapshot-testing-core/src/main/java/au/com/origin/snapshots/Snapshot.java +++ b/java-snapshot-testing-core/src/main/java/au/com/origin/snapshots/Snapshot.java @@ -29,7 +29,7 @@ public String getIdentifier() { } public static Snapshot parse(String rawText) { - String regex = "^(?.*?)(\\[(?.*)\\])?=(?
\\{.*\\})?(?(.*)$)"; + String regex = "^(?.*?)(\\[(?.*)\\])?=(?
\\{.*?\\})?(?(.*)$)"; Pattern p = Pattern.compile(regex, Pattern.DOTALL); Matcher m = p.matcher(rawText); boolean found = m.find();