Skip to content

Commit a4ff2c9

Browse files
author
Alexandros Batsakis
committed
review comments
1 parent 026f493 commit a4ff2c9

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[%header.monospaced.styled,format=dsv,separator=|]
2+
|===
3+
arg1 | arg2 | arg3 | result
4+
keyword | keyword | keyword | keyword
5+
|===

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Replace.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static BytesRef process(BytesRef str, @Fixed Pattern regex, BytesRef newStr) {
8686
}
8787

8888
try {
89-
return new BytesRef(str.utf8ToString().replaceAll(regex.pattern(), newStr.utf8ToString()));
89+
return new BytesRef(regex.matcher(str.utf8ToString()).replaceAll(newStr.utf8ToString()));
9090
} catch (PatternSyntaxException ex) {
9191
// let's return the original string as if there is no match
9292
// we don't want to throw a runtime error

0 commit comments

Comments
 (0)