If there difference between `\A` vs `^` (caret) in regular expression?
<p>Python's <a href="https://docs.python.org/2/library/re.html" rel="nofollow"><code>re</code> module documentation</a> says:</p>

<blockquote>
  <p><code>^</code>: (Caret.) Matches the start of the string, and in MULTILINE mode also matches immediately after each newline.</p>
  
  <p><code>\A</code>: Matches only at the start of the string.</p>
</blockquote>

<p>Is there any difference when using them?</p>

<p>Both of these match:</p>

<pre><code>re.search('^abc', 'abc')
re.search('\Aabc', 'abc')
</code></pre>

<p>This also matches:</p>

<pre><code>re.search('^abc', 'firstline\nabc', re.M)
</code></pre>

<p>This does not:</p>

<pre><code>re.search('\Aabc', 'firstline\nabc', re.M)
</code></pre>

python regex python-2.7