r ngram extraction with regex
问题 Karl Broman's post: https://kbroman.wordpress.com/2015/06/22/randomized-hobbit-2/ got me playing with regex and ngrams just for fun. I attempted to use regex to extract 2-grams. I know there are parsers to do this but am interested in the regex logic (i.e., it was a self challenge that I failed to meet). Below I give a minimal example and the desired output. The problem in my attempt is 2 fold: The grams (words) get eaten up and aren't available for the next pass. How can I make them