Skip to content

Instantly share code, notes, and snippets.

@valterh4ck3r
Forked from marcusedu/patterns.dart
Created January 29, 2019 19:02
Show Gist options
  • Save valterh4ck3r/2a4fe2717e74795ff79ff2c83537fc90 to your computer and use it in GitHub Desktop.
Save valterh4ck3r/2a4fe2717e74795ff79ff2c83537fc90 to your computer and use it in GitHub Desktop.
Expressões regulares de uso comum
final RegExp email = RegExp(
r"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]"
r"{0,253}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a"
r"-zA-Z0-9])?)*$",
caseSensitive: false,
multiLine: false);
final RegExp mobileBrazilianPhone = RegExp(r"^\(?0?\d{2}\)? ?9 ?\d{4}-?\d{4}$",
caseSensitive: false, multiLine: false);
final RegExp brazilianZipCode =
RegExp(r"^\d{5}[. -]?\d{3}$", caseSensitive: false, multiLine: false);
final RegExp dateMDY = RegExp(
r"^(1[012]{1}|0?[1-9])[/\-.][0123]?([123]{1}\d|0?\d)[/\-.](\d{4}|\d{2})$",
caseSensitive: false,
multiLine: false);
final RegExp dateDMY = RegExp(
r"^[0123]?([123]{1}\d|0?\d)[/\-.](1[012]{1}|0?[1-9])[/\-.](\d{4}|\d{2})$",
caseSensitive: false,
multiLine: false);
final RegExp fullName = RegExp(r"^\w{2,} \w{2,}.*$");
final RegExp postalCode = RegExp(r"^\d{5,5}-?\d{3,3}$");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment