Parses a regular expression and returns, if successful, an RE2 instance that can be used to match against text. When matching against text, the regexp returns a match that begins as early as possible in the input (leftmost), and among those it chooses the one that a backtracking search
(String expr)
| 155 | * backtracking. For POSIX leftmost-longest matching, see {@link #compilePOSIX}. |
| 156 | */ |
| 157 | static RE2 compile(String expr) throws PatternSyntaxException { |
| 158 | return compileImpl(expr, PERL, /*longest=*/ false); |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * {@code compilePOSIX} is like {@link #compile} but restricts the regular expression to POSIX ERE |