Package com.google.errorprone.util
Class Regexes
java.lang.Object
com.google.errorprone.util.Regexes
public final class Regexes extends Object
Utilities for checks that work with regexes.
-
Method Summary
Modifier and Type Method Description static Optional<String>
convertRegexToLiteral(String s)
If the given regexes matches exactly one string, returns that string.
-
Method Details
-
convertRegexToLiteral
If the given regexes matches exactly one string, returns that string. Otherwise returnsnull
. This can be used to identify arguments to e.g.String.replaceAll
that don't need to be regexes.
-