title: grep() regex with new line characters
body: <p>I am totally stuck with regex in R. I use www.regex101.com to check my regex and it seems to work. But in R it doesn't. 
  I've read that there are fine and not-so-fine differences between different flavors, but I don't see where these differences are or what to look out for. Is there a way to make more advanced regtex with <code>lookahead</code>'s etc. work in R functions like <code>grep(), sub(), gregexpr()</code>?   </p>
  
  <p>This is my string:</p>
  
  <pre><code>x &lt;- "n\n\nwelcome\nstar\n\n\n\n\nhowdy\nstar\n\n\n\n\nhi\nstar\n\n\n\n\ngreetings\nstar"
  </code></pre>
  
  <p>this is my regex:</p>
  
  <pre><code>"/(?&lt;=\\n)((?:(?!\\n).)*?)(?=\\nstar)/g"
  </code></pre>
  
  <p>this is what i've tried in R:</p>
  
  <pre><code>x &lt;- grep("(?&lt;=\\n)((?:(?!\\n).)*?)(?=\\nstar)",x,perl=TRUE,value=TRUE)
  </code></pre>
  
  <p>OR</p>
  
  <pre><code> x &lt;- grep("/(?&lt;=\\n)((?:(?!\\n).)*?)(?=\\nstar)/g",x,perl=TRUE,value=TRUE)
  </code></pre>
  
  <p>this is the output I would like to get:</p>
  
  <pre><code>"welome"        "howdy"         "hi"       "greetings"
  </code></pre>
  
  <p>Thank you!</p>