title: Add R to a dynamically created regex pattern
body: <p>I would like to create a regex pattern dynamically. I am able to build the string that contains the pattern. Now, in a definition like</p>
  
  <pre><code>  std::regex pattern{ R"((\w)+)" };
  </code></pre>
  
  <p>the <code>"((\w)+)"</code> needs to be my string containing the pattern I am creating. </p>
  
  <p>But how can I add the <code>R</code> outside of the string?</p>
  
  <p>I could create the string using escape characters. But I am curious if there is a way around it.</p>
  
  <p>Suppose </p>
  
  <pre><code>std::string myPatternWithoutEscapeChar;
  </code></pre>
  
  <p>is my string that contains a regex without escape characters, say <code>([\]+)</code> as opposed to <code>([\\]+)</code></p>
  
  <p>I would like to do what amounts to </p>
  
  <pre><code>  std::regex pattern{ R... };
  </code></pre>
  
  <p>with that <code>R</code> as in the first definition above and where <code>...</code> is the content of <code>myPatternWithoutEscapeChar</code> inside <code>""</code>.</p>