org.apache.sling.validation.impl.validators

## Class RegexValidator

- java.lang.Object
- - org.apache.sling.validation.impl.validators.RegexValidator

All Implemented Interfaces:
  org.apache.sling.validation.spi.Validator<String>

    public class RegexValidator
    extends Object
    implements org.apache.sling.validation.spi.Validator<String>

Performs regular expressions validation on the supplied data with the help of the `Pattern` class. This `Validator` expects a mandatory parameter in the arguments map: `REGEX_PARAM`.

### Field Summary

Fields
`static String` `I18N_KEY_PATTERN_DOES_NOT_MATCH`
`static String` `REGEX_PARAM`

### Fields inherited from interface org.apache.sling.validation.spi.Validator

`PROPERTY_VALIDATOR_ID, PROPERTY_VALIDATOR_SEVERITY`

### Constructor Summary

Constructors
Constructor and Description
`RegexValidator()`

### Method Summary

All Methods Instance Methods Concrete Methods
`org.apache.sling.validation.ValidationResult` `validate(String data, org.apache.sling.validation.spi.ValidatorContext context, org.apache.sling.api.resource.ValueMap arguments)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### I18N_KEY_PATTERN_DOES_NOT_MATCH

    @Nonnull
    public static final String I18N_KEY_PATTERN_DOES_NOT_MATCH

See Also:
  Constant Field Values

#### REGEX_PARAM

    @Nonnull
    public static final String REGEX_PARAM

See Also:
  Constant Field Values

### Constructor Detail

#### RegexValidator

    public RegexValidator()

### Method Detail

#### validate

    @Nonnull
    public org.apache.sling.validation.ValidationResult validate(@Nonnull
                                                                          String data,
                                                                          @Nonnull
                                                                          org.apache.sling.validation.spi.ValidatorContext context,
                                                                          @Nonnull
                                                                          org.apache.sling.api.resource.ValueMap arguments)
                                                                   throws org.apache.sling.validation.SlingValidationException

Specified by:
  `validate` in interface `org.apache.sling.validation.spi.Validator<String>`
Throws:
  `org.apache.sling.validation.SlingValidationException`