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

com.networknt.schema.regex.RegularExpression Maven / Gradle / Ivy

There is a newer version: 1.5.3
Show newest version
package com.networknt.schema.regex;

import com.networknt.schema.ValidationContext;

@FunctionalInterface
public interface RegularExpression {
    boolean matches(String value);

    static RegularExpression compile(String regex, ValidationContext validationContext) {
        if (null == regex) return s -> true;
        return validationContext.getConfig().isEcma262Validator()
            ? new JoniRegularExpression(regex)
            : new JDKRegularExpression(regex);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy