Skip to content

Commit

Permalink
Fix Regex example
Browse files Browse the repository at this point in the history
Fixed a regex example which accepts two parameters instead of one http://docs.php.net/manual/en/mongodb-bson-regex.construct.php#refsect1-mongodb-bson-regex.construct-examples

Co-Authored-By: ryan7n <ryan7n@users.noreply.github.com>
  • Loading branch information
divine and ryan7n committed Jan 30, 2020
1 parent 2efa5af commit d26a192
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ Selects documents where values match a specified regular expression.
```php
use MongoDB\BSON\Regex;

User::where('name', 'regex', new Regex("/.*doe/i"))->get();
User::where('name', 'regex', new Regex('.*doe', 'i'))->get();
```

**NOTE:** you can also use the Laravel regexp operations. These are a bit more flexible and will automatically convert your regular expression string to a `MongoDB\BSON\Regex` object.
Expand Down

0 comments on commit d26a192

Please sign in to comment.