MONGOREGEX(3) 1 MONGOREGEX(3)
The MongoRegex class
INTRODUCTION
This class can be used to create regular expressions. Typically, these expressions will be used to query the database and find matching
strings. More unusually, they can be saved to the database and retrieved.
Regular expressions consist of four parts. First a / as starting delimiter, then the pattern, another / and finally a string containing
flags.
Example #1
Regular expression pattern
/pattern/flags
MongoDB recognizes six regular expression flags:
o i: Case insensitive
o m: Multiline
o x: Can contain comments
o l: locale
o s: dotall, "." matches everything, including newlines
o u: match unicode
CLASS SYNOPSIS
MongoRegex
MongoRegex
Fields
o public string$regex
o public string$flags
Methods
o public MongoRegex::__construct (string $regex)
o public string MongoRegex::__toString (void )
PHP Documentation Group MONGOREGEX(3)