title: Escape special character ^ in a regular expression in Java
body: <p>I want to split a string in Java with the following format:
  "value^1" so that I get the initial part, "value" in a string.</p>
  
  <p>I wanted to use split instead of substring, so I tried this:</p>
  
  <pre><code>string.split("^")[0]
  </code></pre>
  
  <p>but unfortunately ^ is a special character and I guess it has to be escaped. I tried split("\^") but no luck.</p>
  
  <p>Anybody knows how to achieve this using split?</p>
  
  <p>Thanks!</p>