From ca46edbb425079ea82dc5aa218451a8a5d96ee8d Mon Sep 17 00:00:00 2001 From: Moshe Kaplan Date: Wed, 14 Sep 2016 15:15:56 -0400 Subject: [PATCH] Clarified string documentation --- doc/script-reference/types.rst | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/doc/script-reference/types.rst b/doc/script-reference/types.rst index d9d306b70b..2755de40b5 100644 --- a/doc/script-reference/types.rst +++ b/doc/script-reference/types.rst @@ -150,18 +150,15 @@ Here is a more detailed description of each type: .. bro:type:: string - A type used to hold character-string values which represent text, although - strings in a Bro script can actually contain any arbitrary binary data. + A type used to hold bytes which represent text or binary data. String constants are created by enclosing text within a pair of double quotes ("). A string constant cannot span multiple lines in a Bro script. - The backslash character (\\) introduces escape sequences. The - following escape sequences are recognized: ``\n``, ``\t``, ``\v``, ``\b``, + The backslash character (\\) introduces escape sequences. Bro recognizes + the following escape sequences: ``\\``, ``\n``, ``\t``, ``\v``, ``\b``, ``\r``, ``\f``, ``\a``, ``\ooo`` (where each 'o' is an octal digit), - ``\xhh`` (where each 'h' is a hexadecimal digit). For escape sequences - that don't match any of these, Bro will just remove the backslash (so - to represent a literal backslash in a string constant, you just use - two consecutive backslashes). + ``\xhh`` (where each 'h' is a hexadecimal digit). If Bro does not + recognize an escape sequence, Bro will ignore the backslash ("\\g" becomes "g"). Strings support concatenation (``+``), and assignment (``=``, ``+=``). Strings also support the comparison operators (``==``, ``!=``, ``<``,