title: String matches() not able to pick ^
body: <p>I was trying to do an regex expression evaluation using java.</p>
  
  <p>^ - Should match everything that starts with it Example: ^begin (This means it should match everything that start with begin)</p>
  
  <p>Below is the Java on the same</p>
  
  <pre><code>public class RgexTEst {
  
      public static void main(String args[]){
  
          String a = "888111231";
      String rgex = "8881";
          System.out.println(a.matches("^"+(rgex)));
  
  
      }
  }
  </code></pre>
  
  <p>Here I am trying to match those which start with "8881" but it is resulting in false.</p>
  
  <p>I already have the answer using .* and startWith(). I want to know how it can be done using ^</p>