Skip to content

Commit f234cc8

Browse files
committed
Improve regex
1 parent d1f0d85 commit f234cc8

File tree

1 file changed

+1
-1
lines changed
  • java-snapshot-testing-core/src/main/java/au/com/origin/snapshots

1 file changed

+1
-1
lines changed

java-snapshot-testing-core/src/main/java/au/com/origin/snapshots/Snapshot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public String getIdentifier() {
2929
}
3030

3131
public static Snapshot parse(String rawText) {
32-
String regex = "^(?<name>.*?)(\\[(?<scenario>.*)\\])?=(?<header>\\{.*?\\})?(?<snapshot>(.*)$)";
32+
String regex = "^(?<name>.*?)(\\[(?<scenario>[^]]*)])?=(?<header>\\{[^}]*?})?(?<snapshot>(.*)$)";
3333
Pattern p = Pattern.compile(regex, Pattern.DOTALL);
3434
Matcher m = p.matcher(rawText);
3535
boolean found = m.find();

0 commit comments

Comments
 (0)