[SERVER-2943] dotall flag 's' from PCRE is not supported Created: 13/Apr/11 Updated: 12/Jul/16 Resolved: 14/Apr/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 1.8.0, 1.8.1 |
| Fix Version/s: | 1.9.0 |
| Type: | Bug | Priority: | Trivial - P5 |
| Reporter: | Charles-Henri d'Adhémar | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | regex | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
All |
||
| Attachments: |
|
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Participants: |
| Description |
|
MongoDb does not support the dotall 's' flag from Perl Compatible Regular Expressions. Example in pseudo code : t = "foo\nbar\nnil" If the dotall 's' flag was supported then the regular expression would match. r = "foo[\s\S]*nil" Since the documentation mention that MongoDB supports PCRE I consider this as a bug, none critical since a workaround exists. The bug is trivial to fix. See attached patch below. However the patch does not solve potential issues with other drivers such the javascript shell. Since this is my first contact with the MongoDb community I would like to take the opportunity to thank you all for the amazing work around MongoDb Cheers, |
| Comments |
| Comment by Charles-Henri d'Adhémar [ 15/Apr/11 ] |
|
Ok, a big thank you for your support ! |
| Comment by Mathias Stearn [ 15/Apr/11 ] |
|
It looks like the python driver will do the right thing when you On Fri, Apr 15, 2011 at 3:27 AM, Charles-Henri d'Adhemar (JIRA) |
| Comment by Mathias Stearn [ 15/Apr/11 ] |
|
It looks like the python driver will do the right thing when you specify the DOTALL option to compiled regex objects. |
| Comment by Charles-Henri d'Adhémar [ 15/Apr/11 ] |
|
Thanks a lot for having done so fast |
| Comment by Mathias Stearn [ 14/Apr/11 ] |
|
Thanks for the patch. If you want to use the 's' flag from javascript you will need to use the following syntax: db.foo.find({fieldName: { $regex: 'asdf.*asdf', $options: 'is'}}) |
| Comment by auto [ 14/Apr/11 ] |
|
Author: {u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}Message: Add support for s (DOT_ALL) regex option |