Skip to content

Commit

Permalink
Improve secret replacement matching reg ex (#18234)
Browse files Browse the repository at this point in the history
* Improve secret replacement matching reg ex

* Remove System.out.println
  • Loading branch information
jdpgrailsdev authored Oct 20, 2022
1 parent 672260a commit 2d32e9d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private String generatePattern(final Set<String> properties) {
builder.append("(?i)"); // case insensitive
builder.append("\"(");
builder.append(properties.stream().collect(Collectors.joining("|")));
builder.append(")\"\\s*:\\s*\"?((\\\\\"|[^\",}])*)\"?");
builder.append(")\"\\s*:\\s*(\"(?:[^\"\\\\]|\\\\.)*\"|\\[[^]\\[]*]|\\d+)");
return builder.toString();
}

Expand Down

0 comments on commit 2d32e9d

Please sign in to comment.