nonLetter method

FluentRegex nonLetter({
  1. CaseType caseType = CaseType.lowerAndUpper,
  2. Quantity quantity = const Quantity.oneTime(),
})

Example: var regex = FluentRegex().nonLetter(); expect(regex.hasMatch('5'), true); expect(regex.hasMatch('_'), true); expect(regex.hasMatch('%'), true); expect(regex.hasMatch('l'), false); expect(regex.hasMatch('W'), false);

Implementation

FluentRegex nonLetter(
    {CaseType caseType = CaseType.lowerAndUpper,
    Quantity quantity = const Quantity.oneTime()}) {
  switch (caseType) {
    case CaseType.lower:
      return FluentRegex._copyWith(this,
          expression: '$_expression[^a-z]$quantity');
    case CaseType.upper:
      return FluentRegex._copyWith(this,
          expression: '$_expression[^A-Z]$quantity');
    case CaseType.lowerAndUpper:
      return FluentRegex._copyWith(this,
          expression: '$_expression[^a-zA-Z]$quantity');
  }
}