[DOCS-5740] Comment on: "manual/search.txt" for \\Q Created: 29/Jun/15  Updated: 03/Nov/17  Resolved: 29/Jun/15

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Allison Reinheimer Moore
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Location: https://docs.mongodb.org/manual/search/?query=%22%5CQ%22
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36
Referrer: https://docs.mongodb.org/manual/search/?query=%5CQ
Screen Resolution: 1920 x 1080
repo: docs
source: search


Participants:
Days since reply: 8 years, 33 weeks, 2 days ago

 Description   

I'm trying to search some info about what \Q and \E means in a $regex search, but I can't find information about it in the documentation.

Regards



 Comments   
Comment by Allison Reinheimer Moore [ 29/Jun/15 ]

Covering regular expressions as a whole is, unfortunately, out of the scope of our documentation. I'd suggest stackoverflow as a great place to find the answers to these kinds of questions. Thanks!

Comment by Allison Reinheimer Moore [ 29/Jun/15 ]

In many flavors of regex, including the one MongoDB uses, you can use \Q .. \E to escape the characters bracketed by the \Q and \E. \Q marks the beginning of the escaped quote, while \E the end.

This may provide some guidance: http://www.regular-expressions.info/characters.html (under Special Characters, it discusses the \Q .. \E escape sequence).

Generated at Thu Feb 08 07:50:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.