Creates {@link Pattern} objects equivalent to given HQL/JPQL {@code LIKE} expressions.
Used by {@link org.hibernate.ogm.datastore.mongodb.query.parsing.predicate.impl.MongoDBLikePredicate} to run {@code LIKE}queries against MongoDB, using the {@code $regex} operator.
The following rules apply for creating regular expressions:
the {@code _} wildcard is replaced by {@code .} (unless it is escaped)
the {@code %} wildcard is replaced by {@code .*} (unless it is escaped)
non-wildcard character sequences are quoted (wrapped by {@code \\Q...\\E}) to match them as is
escape characters are omitted from the resulting pattern
the pattern is wrapped by {@code ^...$} to make sure the entire string is matched
the reg exp wildcard {@code .} matches line breaks
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.