Skip to content

Commit 78a3d5b

Browse files
committed
Format tutorial section on regular expressions
1 parent 7213bdc commit 78a3d5b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/tutorials/bson-v4.txt

+11-11
Original file line numberDiff line numberDiff line change
@@ -280,22 +280,22 @@ deserialized, they will always be returned as a ``Time`` since the BSON
280280
specification only has a ``Time`` type and knows nothing about Ruby.
281281

282282

283-
Using Regexes
284-
-----------------
283+
Regular Expressions
284+
-------------------
285285

286-
Ruby regular expressions always have BSON regular expression's equivalent of 'm' on.
287-
In order for behavior to be preserved between the two, the 'm' option is always added
288-
when a Ruby regular expression is serialized to BSON.
286+
Ruby regular expressions always have BSON regular expressions' equivalent of
287+
'm' flag on. In order for behavior to be preserved between the two, the 'm'
288+
option is always added when a Ruby regular expression is serialized to BSON.
289289

290-
There is a class provided by the bson gem, ``Regexp::Raw``, to allow Ruby users to get around this.
291-
You can simply create a regular expression like this:
290+
There is a class provided by the bson gem, ``Regexp::Raw``, to allow Ruby users
291+
to get around this. You can simply create a regular expression like this:
292292

293293
.. code-block:: ruby
294294

295295
Regexp::Raw.new("^b403158")
296296

297-
This code example illustrates the difference between serializing a core Ruby ``Regexp`` versus a
298-
``Regexp::Raw`` object:
297+
This code example illustrates the difference between serializing a core Ruby
298+
``Regexp`` versus a ``Regexp::Raw`` object:
299299

300300
.. code-block:: ruby
301301

@@ -313,8 +313,8 @@ This code example illustrates the difference between serializing a core Ruby ``R
313313
# => "^b403158\x00\x00"
314314

315315

316-
Please use the ``Regexp::Raw`` class to instantiate your BSON regular expressions to get the exact
317-
pattern and options you want.
316+
Please use the ``Regexp::Raw`` class to instantiate your BSON regular
317+
expressions to get the exact pattern and options you want.
318318

319319
When regular expressions are deserialized, they return a wrapper that holds the
320320
raw regex string, but do not compile it. In order to get the Ruby ``Regexp``

0 commit comments

Comments
 (0)