1) Exactly the word "bear" Filename : words.txt Total lines : 329359 Total words : 329359 Regex : bear Regex matches : 1 2) Words that contain "bear" Filename : words.txt Total lines : 329359 Total words : 329359 Regex : .*bear.* Regex matches : 169 3) Words that start with "pre" and end in "ing" Filename : words.txt Total lines : 329359 Total words : 329359 Regex : pre.*ing Regex matches : 142 4) Three letter words that start and end with a vowel (vowels = aeiou) Filename : words.txt Total lines : 329359 Total words : 329359 Regex : [aeiou].[aeiou] Regex matches : 181 5) 2, 3 or 4 letter words that start and end with a vowel (vowels = aeiou) Filename : words.txt Total lines : 329359 Total words : 329359 Regex : [aeiou].{0,2}[aeiou] Regex matches : 707 6) Words then end in one of the following contractions: 'll 're 'nt Filename : words.txt Total lines : 329359 Total words : 329359 Regex : .*('ll|'re|'nt) Regex matches : 34 7) Social updates that start with "keith is " Filename : social.txt Total lines : 1000000 Total words : 10579039 Regex : keith is .* Regex matches : 2 8) Social updates that do not contain any vowels (vowels = aeiou) Filename : social.txt Total lines : 1000000 Total words : 10579039 Regex : [^aeiou]+ Regex matches : 13 9) Social updates that consist of three 3-letter words. Filename : social.txt Total lines : 1000000 Total words : 10579039 Regex : ... ... ... Regex matches : 180 10) Social updates that contain at least one word that is 20 or more characters long. Filename : social.txt Total lines : 1000000 Total words : 10579039 Regex : .*[a-z']{20,}.* Regex matches : 8 11) All three word social updates. Filename : social.txt Total lines : 1000000 Total words : 10579039 Regex : [a-z']+ [a-z']+ [a-z']+ Regex matches : 40783 12) Social updates that do not contain any vowels. Filename : social.txt Total lines : 1000000 Total words : 10579039 Regex : [^aeiou]+ Regex matches : 13 13) Social updates with 30 or more words where the last word ends in the letter s. Filename : social.txt Total lines : 1000000 Total words : 10579039 Regex : ([a-z']+ ){29,}([a-z']*s) Regex matches : 2001 14) Social updates containing the word sequence "bowl of cereal" anywhere in the sentence (at the start, in the middle, at the end, or as the whole sentence). Filename : social.txt Total lines : 1000000 Total words : 10579039 Regex : (bowl of cereal .*)|(.* bowl of cereal .*)|(.* bowl of cereal)|(bowl of cereal) Regex matches : 1781 15) Social updates containing at least one word in which the second-to-last letter is z (the z-word may be in the middle of the sentence or at the end). Filename : social.txt Total lines : 1000000 Total words : 10579039 Regex : (.*[a-z']+z[a-z'] .*)|(.*[a-z']+z[a-z']) Regex matches : 11553