Why is this exception thrown when trying to match this regex in Java?
<p>I'm trying to match a specific string out of a an HTML document and have this regex pattern to grab it:</p>

<pre><code>Pattern somePattern = Pattern.compile("var json = ({\"r\":\"^d1\".*});");
</code></pre>

<p>However when I try to hit that code at runtime, I get this error:</p>

<pre><code>FATAL EXCEPTION: Timer-0
 java.util.regex.PatternSyntaxException: Syntax error U_REGEX_RULE_SYNTAX near index 13:
 var json = ({"r":"^d1".*});
              ^
     at com.ibm.icu4jni.regex.NativeRegEx.open(Native Method)
     at java.util.regex.Pattern.compileImpl(Pattern.java:383)
     at java.util.regex.Pattern.&lt;init&gt;(Pattern.java:341)
     at java.util.regex.Pattern.compile(Pattern.java:317)
</code></pre>

<p>Can anybody tell me what I'm doing wrong?</p>
