Class | BSON::Regex |
In: |
lib/bson/types/regex.rb
|
Parent: | Object |
generates a wrapped Regexp with lazy compilation. can represent flags not supported in Ruby‘s core Regexp class before compilation.
IGNORECASE | = | 0x01 |
LOCALE_DEPENDENT | = | 0x02 |
MULTILINE | = | 0x04 |
DOTALL | = | 0x08 |
UNICODE | = | 0x10 |
EXTENDED | = | 0x20 |
pattern | -> | source |
options | [RW] | |
pattern | [RW] |
Attempt to convert a native Ruby Regexp to a BSON::Regex.
@note Warning: Ruby regular expressions use a different syntax and different
set of flags than BSON regular expressions. A regular expression matches different strings when executed in Ruby than it matches when used in a MongoDB query, if it can be used in a query at all.
@param regexp [Regexp] The native Ruby regexp object to convert to BSON::Regex.
@return [BSON::Regex]
Compile the BSON::Regex.
@note Warning: regular expressions retrieved from the server may include a pattern
that cannot be compiled into a Ruby regular expression, or which matches a different set of strings in Ruby than it does when used in a MongoDB query, or it may have flags that are not supported by Ruby regular expressions.
@return [Regexp] A ruby core Regexp object.