All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.cucumber.cucumberexpressions.PatternCompiler Maven / Gradle / Ivy

Go to download

Cucumber Expressions are simple patterns for matching Step Definitions with Gherkin steps

There is a newer version: 18.0.1
Show newest version
package io.cucumber.cucumberexpressions;

import org.apiguardian.api.API;

import java.util.regex.Pattern;

/**
 * Abstracts creation of new {@link Pattern}. In some platforms and Java versions some flags are not supported (e.g {@link Pattern#UNICODE_CHARACTER_CLASS} on Android) - clients for those platforms should provide resource {@code META-INF/services/io.cucumber.cucumberexpressions.PatternCompiler} pointing to implementation of this interface.
 *
 * @see DefaultPatternCompiler
 * @see java.util.ServiceLoader
 */
@API(status = API.Status.STABLE)
@FunctionalInterface
public interface PatternCompiler {

    /**
     * @param regexp regular expression
     * @param flags  additional flags (e.g. {@link Pattern#UNICODE_CHARACTER_CLASS})
     * @return new {@link Pattern} instance from provided {@code regexp}
     */
    Pattern compile(String regexp, int flags);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy