MongoDB\BSON\Regex::getPattern
PHP function
Edit on GitHub ✎
(mongodb >=1.0.0)
Returns the Regex's pattern
Description
MongoDB\BSON\Regex::getPattern(): string
Parameters Parameters
Return Values
Returns the Regex's pattern.
Errors/Exceptions
Examples
MongoDB\BSON\Regex::getPattern() example
php
<?php
$regex = new MongoDB\BSON\Regex('regex', 'i');
var_dump($regex->getPattern());
?>The above example will output something similar to:
output
string(5) "regex"See Also
- BSON Types