/** * Specifies that this pattern is optional for a final match of the pattern * sequence to happen. * * @return The same pattern as optional. * @throws MalformedPatternException if the quantifier is not applicable to this pattern. */ public Pattern<T, F> optional() { checkIfPreviousPatternGreedy(); quantifier.optional(); return this; }
/** * Specifies that this pattern is optional for a final match of the pattern * sequence to happen. * * @return The same pattern as optional. * @throws MalformedPatternException if the quantifier is not applicable to this pattern. */ public Pattern<T, F> optional() { checkIfPreviousPatternGreedy(); quantifier.optional(); return this; }
/** * Specifies that this pattern is optional for a final match of the pattern * sequence to happen. * * @return The same pattern as optional. * @throws MalformedPatternException if the quantifier is not applicable to this pattern. */ public Pattern<T, F> optional() { checkIfPreviousPatternGreedy(); quantifier.optional(); return this; }