Skip to content

Commit

Permalink
refactor by removing redundant character escape '\\}' in RegExp
Browse files Browse the repository at this point in the history
  • Loading branch information
renanfranca committed May 8, 2024
1 parent 29063a4 commit d7db1c5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ private String appendNewRootEntry(String result) {
.append(QUOTE)
.toString();

return result.replaceFirst("(\\s{1,10})\\}(\\s{1,10})$", jsonBloc + "$1}$2");
return result.replaceFirst("(\\s{1,10})}(\\s{1,10})$", jsonBloc + "$1}$2");
}

private String appendNewBlock(String result) {
Expand All @@ -262,7 +262,7 @@ private String appendNewBlock(String result) {
.append("}")
.toString();

return result.replaceFirst("(\\s{1,10})\\}(\\s{1,10})$", jsonBloc + "$1}$2");
return result.replaceFirst("(\\s{1,10})}(\\s{1,10})$", jsonBloc + "$1}$2");
}

private Matcher buildBlocMatcher(String result) {
Expand Down

0 comments on commit d7db1c5

Please sign in to comment.