title: What exactly is a "raw string regex" and how can you use it?
body: <p>From the python documentation on <a href="https://docs.python.org/library/re.html">regex</a>, regarding the <code>'\'</code> character:</p>
  
  <blockquote>
    <p>The solution is to use Python’s raw string notation for regular
    expression patterns; backslashes are not handled in any special way in
    a string literal prefixed with <code>'r'</code>. So <code>r"\n"</code> is a two-character string
    containing <code>'\'</code> and <code>'n'</code>, while <code>"\n"</code> is a one-character string
    containing a newline. Usually patterns will be expressed in Python
    code using this raw string notation.</p>
  </blockquote>
  
  <p>What is this raw string notation? If you use a raw string format, does that mean <code>"*"</code> is taken as a a literal character rather than a zero-or-more indicator? That obviously can't be right, or else regex would completely lose its power. But then if it's a raw string, how does it recognize newline characters if <code>"\n"</code> is literally a backslash and an <code>"n"</code>?</p>
  
  <p>I don't follow.</p>
  
  <p><strong>Edit for bounty:</strong></p>
  
  <p>I'm trying to understand how a raw string regex matches newlines, tabs, and character sets, e.g. <code>\w</code> for words or <code>\d</code> for digits or all whatnot, if raw string patterns don't recognize backslashes as anything more than ordinary characters. I could really use some good examples.</p>