I am really fresh to Regular Expression, how can I write a regex to allow either null or any positive numbers greater than zero?
@Getter
@Setter
public class CacheCreateRequest {
.
.
.
@Pattern(regexp = RegexConstants.REGEX_POSITIVE_INTEGERS, message =
I18NKey.VALIDATION_FIELD_REPLICATION)
private Integer replication;
}
How can I specify the REGEX in "REGEX_POSITIVE_INTEGERS"
public static final String REGEX_POSITIVE_INTEGERS = ".....";
Thanks