procurarCEP static method

List<String> procurarCEP(
  1. string texto
)

Procura CEPs em uma string

Implementation

static List<String> procurarCEP(string texto) {
  const regexCep = r'\d{5}-\d{3}';
  const regexNumbers = r'\d{8}';

  final matchesCep = texto.findByRegex(regexCep);
  final matchesNumbers = texto.findByRegex(regexNumbers);

  return matchesCep.union(matchesNumbers).toList();
}