notAlphaNum static method

Pattern notAlphaNum([
  1. int? min,
  2. int? max
])

Matches any non-alphanumeric character

Implementation

static Pattern notAlphaNum([int? min, int? max]) {
  final node = nodes.CharacterClass(
    negated: true,
    members: [
      nodes.Range(from: 'A', to: 'Z'),
      nodes.Range(from: 'a', to: 'z'),
      nodes.Range(from: '0', to: '9'),
    ],
  );
  final pattern = Pattern._(node);
  return (min != null) ? pattern.repeat(min, max) : pattern;
}