title: Do RE2-like regular expression library for Java exist?
body: <p>Did anyone come across Java version of Google's regular expression library RE2 or a java library with similar capabilities and good performance? The performance requirement is linear time with regard to the length of regular expression and the input text length.</p>
  
  <h2>Clarification</h2>
  
  <p>Most regular expression implementation use a backtracking algorithm to match the input text and hence are exponential on some simple regular expressions like <code>(.*).(.*).(.*).(.*)</code>. RE2 is a library from google that solves this problem by using an algorithm that varies linearly with input size using the concepts of Automata theory. The questioner wants to know whether there exists libraries for Java that are based on this algorithm.</p>