forked from mongodb/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextracts-agg-regex.yaml
97 lines (70 loc) · 2.9 KB
/
extracts-agg-regex.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
ref: agg-regex-input
content: |
The string on which you wish to apply the |regexpattern|.
Can be a string or any valid :ref:`expression
<aggregation-expressions>` that resolves to a string.
---
ref: agg-regex-pattern
content: |
The regex pattern to apply. Can be any valid :ref:`expression
<aggregation-expressions>` that resolves to either a string or regex
pattern ``/<pattern>/``. When using the regex ``/<patthern>/``, you
can also specify the regex options ``i`` and ``m`` (but not the
``s`` or ``x`` options):
- ``"pattern"``
- ``/<pattern>/``
- ``/<pattern>/<options>``
Alternatively, you can also specify the regex options with the
|regexoptions| field. To specify the ``s`` or ``x`` options, you
must use the |regexoptions| field.
You cannot specify options in both the ``regex`` and the ``options``
field.
---
ref: agg-regex-options
content: |
*Optional*. The following ``<options>`` are available for use
with regular expression.
.. note::
You cannot specify options in both the ``regex`` and the
``options`` field.
.. list-table::
:header-rows: 1
:widths: 10 90
* - Option
- Description
* - ``i``
- Case insensitivity to match both upper and lower cases. You
can specify the option in the ``options`` field or as part of
the regex field.
* - ``m``
- For patterns that include anchors (i.e. ``^`` for the start,
``$`` for the end), match at the beginning or end of each
line for strings with multiline values. Without this option,
these anchors match at beginning or end of the string.
If the pattern contains no anchors or if the string value has
no newline characters (e.g. ``\n``), the ``m`` option has no
effect.
* - ``x``
- "Extended" capability to ignore all white space characters
in the pattern unless escaped or included in a character
class.
Additionally, it ignores characters in-between and including
an un-escaped hash/pound (``#``) character and the next new
line, so that you may include comments in complicated
patterns. This only applies to data characters; white space
characters may never appear within special character
sequences in a pattern.
The ``x`` option does not affect the handling of the VT
character (i.e. code 11).
You can specify the option only in the ``options`` field.
* - ``s``
- Allows the dot character (i.e. ``.``) to match all
characters *including* newline characters.
You can specify the option only in the ``options`` field.
---
ref: agg-regex-options-one-place-only
content: |
.. note::
You cannot specify options in both the ``regex`` and the
``options`` field.
...