Update documentation for builtin types

Add missing description of interval "msec" unit.
Improved description of pattern by clarifying the issue of operand
order and difference between exact and embedded matching.
This commit is contained in:
Daniel Thayer 2012-08-23 13:04:18 -05:00
parent 58b5109e01
commit c1c9c9e34a

View file

@ -55,8 +55,8 @@ The Bro scripting language supports the following built-in types.
A temporal type representing a relative time. An ``interval`` A temporal type representing a relative time. An ``interval``
constant can be written as a numeric constant followed by a time constant can be written as a numeric constant followed by a time
unit where the time unit is one of ``usec``, ``sec``, ``min``, unit where the time unit is one of ``usec``, ``msec``, ``sec``, ``min``,
``hr``, or ``day`` which respectively represent microseconds, ``hr``, or ``day`` which respectively represent microseconds, milliseconds,
seconds, minutes, hours, and days. Whitespace between the numeric seconds, minutes, hours, and days. Whitespace between the numeric
constant and time unit is optional. Appending the letter "s" to the constant and time unit is optional. Appending the letter "s" to the
time unit in order to pluralize it is also optional (to no semantic time unit in order to pluralize it is also optional (to no semantic
@ -95,14 +95,14 @@ The Bro scripting language supports the following built-in types.
and embedded. and embedded.
In exact matching the ``==`` equality relational operator is used In exact matching the ``==`` equality relational operator is used
with one :bro:type:`string` operand and one :bro:type:`pattern` with one :bro:type:`pattern` operand and one :bro:type:`string`
operand to check whether the full string exactly matches the operand (order of operands does not matter) to check whether the full
pattern. In this case, the ``^`` beginning-of-line and ``$`` string exactly matches the pattern. In exact matching, the ``^``
end-of-line anchors are redundant since pattern is implicitly beginning-of-line and ``$`` end-of-line anchors are redundant since
anchored to the beginning and end of the line to facilitate an exact the pattern is implicitly anchored to the beginning and end of the
match. For example:: line to facilitate an exact match. For example::
"foo" == /foo|bar/ /foo|bar/ == "foo"
yields true, while:: yields true, while::
@ -110,9 +110,9 @@ The Bro scripting language supports the following built-in types.
yields false. The ``!=`` operator would yield the negation of ``==``. yields false. The ``!=`` operator would yield the negation of ``==``.
In embedded matching the ``in`` operator is again used with one In embedded matching the ``in`` operator is used with one
:bro:type:`string` operand and one :bro:type:`pattern` operand :bro:type:`pattern` operand (which must be on the left-hand side) and
(which must be on the left-hand side), but tests whether the pattern one :bro:type:`string` operand, but tests whether the pattern
appears anywhere within the given string. For example:: appears anywhere within the given string. For example::
/foo|bar/ in "foobar" /foo|bar/ in "foobar"