Class JavaUtilRegexCapabilities

  • All Implemented Interfaces:
    RegexCapabilities

    public class JavaUtilRegexCapabilities
    extends Object
    implements RegexCapabilities
    An implementation tying Java's built-in java.util.regex to RegexQuery. Note that because this implementation currently only returns null from prefix() that queries using this implementation will enumerate and attempt to match(java.lang.String) each term for the specified field in the index.
    • Constructor Detail

      • JavaUtilRegexCapabilities

        public JavaUtilRegexCapabilities()
        Default constructor that uses java.util.regex.Pattern with its default flags.
      • JavaUtilRegexCapabilities

        public JavaUtilRegexCapabilities​(int flags)
        Constructor that allows for the modification of the flags that the java.util.regex.Pattern will use to compile the regular expression. This gives the user the ability to fine-tune how the regular expression to match the functionality that they need. The Pattern class supports specifying these fields via the regular expression text itself, but this gives the caller another option to modify the behavior. Useful in cases where the regular expression text cannot be modified, or if doing so is undesired.
        Parameters:
        flags - The flags that are ORed together.