RegexModel.exactLength constructor

RegexModel.exactLength(
  1. int length, {
  2. String? title,
})

Exactly length characters, e.g. a 6-digit code.

Implementation

factory RegexModel.exactLength(int length, {String? title}) => RegexModel(
  title: title ?? RegexLabels.current.exactLength(length),
  test: (value) => value.runes.length == length,
);