1
0

replace.asciidoc 805 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. [discrete]
  2. [[esql-replace]]
  3. === `REPLACE`
  4. *Syntax*
  5. [.text-center]
  6. image::esql/functions/signature/replace.svg[Embedded,opts=inline]
  7. *Parameters*
  8. `str`::
  9. String expression.
  10. `regex`::
  11. Regular expression.
  12. `newStr`::
  13. Replacement string.
  14. *Description*
  15. The function substitutes in the string `str` any match of the regular expression
  16. `regex` with the replacement string `newStr`.
  17. If any of the arguments is `null`, the result is `null`.
  18. *Supported types*
  19. include::types/replace.asciidoc[]
  20. *Example*
  21. This example replaces any occurrence of the word "World" with the word
  22. "Universe":
  23. [source.merge.styled,esql]
  24. ----
  25. include::{esql-specs}/docs.csv-spec[tag=replaceString]
  26. ----
  27. [%header.monospaced.styled,format=dsv,separator=|]
  28. |===
  29. include::{esql-specs}/docs.csv-spec[tag=replaceString-result]
  30. |===