File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
source/reference/operator Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 7
7
.. operator:: $regex
8
8
9
9
The :operator:`$regex` operator provides regular expression
10
- capabilities in queries. MongoDB uses Perl compatible regular
11
- expressions (i.e. "PCRE."))The following examples are equivalent:
10
+ capabilities for pattern matching *strings* in queries. MongoDB uses Perl compatible regular
11
+ expressions (i.e. "PCRE.")
12
+
13
+ You can specify regular expressions using regular expression
14
+ objects or using the :operator:`$regex` operator. The following
15
+ examples are equivalent:
12
16
13
17
.. code-block:: javascript
14
18
@@ -53,13 +57,13 @@ $regex
53
57
- ``s`` allows the dot (e.g. ``.``) character to match all
54
58
characters *including* newline characters.
55
59
56
- :operator:`$regex` only provides the ``i`` and ``m`` options in the
57
- short JavaScript syntax (i.e . ``/acme.*corp/i``). To use ``x``
60
+ :operator:`$regex` only provides the ``i`` and ``m`` options for
61
+ the native JavaScript regular expression objects (e.g . ``/acme.*corp/i``). To use ``x``
58
62
and ``s`` you must use the ":operator:`$regex`" operator with the
59
63
":operator:`$options`" syntax.
60
64
61
65
To combine a regular expression match with other operators, you
62
- need to specify the ":operator:`$regex`" operator. For example:
66
+ need to use the ":operator:`$regex`" operator. For example:
63
67
64
68
.. code-block:: javascript
65
69
You can’t perform that action at this time.
0 commit comments