Taken from Google Support on Nov 16, 2018.
| What you can search by | Search operator and example |
|---|---|
| Specify the sender | from:Example: from:amy |
| Specify a recipient | to:Example: tso:david |
| Words in the subject line | subject:Example: subject:dinner |
| Messages that match multiple terms | OR or { }Example: from:amy OR from:davidExample: {from:amy from:david} |
| Remove messages from your results | -Example: dinner -movie |
| Find messages with words near each other. Use the number to say how many words apart the words can be Add quotes to find messages in which the word you put first stays first. |
AROUNDExample: dinner AROUND 5 fridayExample: "secret AROUND 25 birthday" |
| Messages that have a certain label | label:Example: label:friends |
| Messages that have an attachment | has:attachmentExample: has:attachment |
| Messages that have a Google Drive, Docs, Sheets, or Slides attachment or link | has:drivehas:documenthas:spreadsheethas:presentationExample: has:drive&has:document |
| Messages that have a YouTube video | has:youtubeExample: has:youtube |
| Messages from a mailing list | list:Example: list:[email protected] |
| Attachments with a certain name or file type | filename:Example: filename:pdfExample: filename:homework.txt |
| Search for an exact word or phrase | " "Example: "dinner and movie tonight" |
| Group multiple search terms together | ( )Example: subject:(dinner movie) |
| Messages in any folder, including Spam and Trash | in:anywhereExample: in:anywhere movie |
| Search for messages that are marked as important | is:importantlabel:importantExample: is:important& |
| Starred, snoozed, unread, or read messages | is:starredis:snoozedis:unreadis:readExample: is:read is:starred |
| Messages that include an icon of a certain color | has:yellow-starhas:blue-infoExample: has:purple-star |
| Recipients in the cc or bcc field | cc:bcc:Example: cc:davidNote: You can't find messages that you received on bcc. |
| Search for messages sent during a certain time period | after:before:older:newer:Example: after:2004/04/16Example: before:2004/04/18 |
| Search for messages older or newer than a time period using d (day), m (month), and y (year) | older_than:newer_than:Example: newer_than:2d |
| Chat messages | is:chatExample: is:chat movie |
| Messages delivered to a certain email address | deliveredto:Example: deliveredto:[email protected] |
| Messages in a certain category | category:Example: category:updates |
| Messages larger than a certain size in bytes | size:Example: size:1000000 |
| Messages larger or smaller than a certain size in bytes | larger:smaller:Example: larger:10M |
| Results that match a word exactly | +Example: +unicorn |
| Messages with a certain message-id header | Rfc822msgid:Example: rfc822msgid:[email protected]& |
| Messages that have or don't have a label | has:userlabelshas:nouserlabelsExample: has:nouserlabels&Note: Labels are only added to a message, and not an entire conversation. |
Convert the table to Markdown by running the following code on the page:
var buffer = [
'| What you can search by | Search operator and example |',
'|------------------------|-----------------------------|'
];
var items = $$('.nice-table tr').map((tr, n) => {
var l = $(`tr:nth-child(${n + 1}) td:first-child`);
var r = $(`tr:nth-child(${n + 1}) td:last-child`);
if (!l) return null;
var lText = l.innerText
.replace(/([^\S]{2,})/ig, '\n\n')
.trim()
.replace(/([\n]{2,})/ig, '<br>');
var rText = r.innerHTML
.replace(/<\/?p>/ig, '\n')
.replace(/<code>(.+?)<\/code>/ig, '`$1`')
.replace(/<strong>(.+?) ?<\/strong>/ig, '**$1**')
.replace(/(\*\*.+?\*\*)([\S]+)/ig, '$1 $2')
.replace(/([^\S]{2,})/ig, '\n\n')
.trim()
.replace(/([\n]{2,})/ig, '<br>')
.replace(' ', '&');
return [lText, rText];
}).filter(n => n);
items.forEach(item => buffer.push(`| ${item[0]} | ${item[1]} |`));
console.log(buffer.join('\n'));
[email protected] #paswords