@Override
        public boolean equals(final Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            final RegexPredicate that = (RegexPredicate) o;
            return negate == that.negate && pattern.pattern().equals(that.pattern.pattern());
        }
Allows for a compiled version of the regex pattern.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Text.java