title: time complexity of regular expression in java
body: <p>I wrote the following a java by using a regular expression to find a repeated String in the String <code>s</code>. Now I try to find the complexity of it, if any one know what is the complexity of it, please let me know.</p>
  
  <pre><code>           String s = "ABCABCAAAABBBBCCAAABCGABCABC";
  
             Pattern pattern = Pattern.compile("(?:([ABC])(?!\\1)([ABC])\\1\\2)+");
             Matcher matcher = pattern.matcher(s);
  
             while (matcher.find()) {
                System.out.print("FOUND");
             }
  </code></pre>