Skip to content

[DOCS] EQL: Replace ?"..." with """...""" for raw strings #63191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions docs/reference/eql/syntax.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ any where true
[[eql-syntax-strings]]
==== Strings

Strings are enclosed with double quotes (`"`).
Strings are enclosed in double quotes (`"`).

[source,eql]
----
Expand Down Expand Up @@ -322,28 +322,22 @@ double quote (`\"`) instead.
[[eql-syntax-raw-strings]]
===== Raw strings

Raw strings are preceded by a question mark (`?`) and treat backslashes (`\`) as
literal characters.
Raw strings treat special characters, such as backslashes (`\`), as literal
characters. Raw strings are enclosed in three double quotes (`"""`).

[source,eql]
----
?"String with a literal blackslash \ character included"
"""Raw string with a literal double quote " and blackslash \ included"""
----

You can escape double quotes (`"`) with a backslash, but the backslash remains
in the resulting string.
A raw string cannot contain three consecutive double quotes (`"""`). Instead,
use a regular string with the `\"` escape sequence.

[source,eql]
----
?"\""
"String containing \"\"\" three double quotes"
----

[NOTE]
====
Raw strings cannot contain only a single backslash or end in an odd number of
backslashes.
====

[discrete]
[[eql-syntax-wildcards]]
===== Wildcards
Expand Down