Help

Teste de RegExp (Expressões Regulares)

On/Off Exemplos

Expressoes Regulares

Tipo EXPRESSAO REGULAR Exemplo
Data (dd/mm/aaaa)^([1-9]|0[1-9]|[1,2][0-9]|3[0,1])/([1-9]|1[0,1,2])/\d{4}$21/12/2012Testar
Numero Decimal^\d*[0-9](\.\d*[0-9])?$234.342Testar
Arquivos Documentos^[a-zA-Z0-9-_\.]+\.(pdf|txt|doc|csv)$world-domination.pdfTestar
E-mail^([0-9a-zA-Z]+([_.-]?[0-9a-zA-Z]+)*@[0-9a-zA-Z]+[0-9,a-z,A-Z,.,-]*(.){1}[a-zA-Z]{2,4})+$info@lymas.com.brTestar
Codigo Cor HTML^#?([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?$#00ccffTestar
Arquivo de Imagem^[a-zA-Z0-9-_\.]+\.(jpg|gif|png)$new-pic_company.jpgTestar
Endereco IP^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$192.168.0.1Testar
Arquivos Multimedia^[a-zA-Z0-9-_\.]+\.(swf|mov|wma|mpg|mp3|wav)$company-presentation.swfTestar
Data Formato Mysql^\d{4}-(0[1-9]|1[0,1,2])-(0[1-9]|[1,2][0-9]|3[0,1])$2012-09-02Testar
Telefone (BR)^\(?\d{2}\)?[\s-]?\d{4}-?\d{4}$(11) 5555-1977Testar
Codigo Postal (EUA)^([A-Z][0-9]){3}$V2B2S3Testar
Hora (HH:MM)^([0-1][0-9]|[2][0-3])(:([0-5][0-9])){1,2}$12:29Testar
URL^(http[s]?://|ftp://)?(www\.)?[a-zA-Z0-9-\.]+\.(com|org|net|mil|edu|ca|co.uk|com.au|gov|br)$http://www.google.comTestar
Telefone Internacional^(([0-9]{1})*[- .(]*([0-9a-zA-Z]{3})*[- .)]*[0-9a-zA-Z]{3}[- .]*[0-9a-zA-Z]{4})+$1.245.532.3422Testar

On/Off Referências

Referências sobre Expressões Regulares

x

Regular Expression Reference

AssertionDescription
^Matches at the beginning of the string.
$Matches at the end of the string.
\bMatches a word boundary (between \w and \W), when not inside [].
\BMatches a non-word boundary.
Quantifier Range
{m,n} Must occur at least m times, but not more than n times.
{n,} Must occur at least n times.
{n} Must occur exactly n times.
* Must occur 0 or more times (same as {0,}).
+ Must occur 1 or more times (same as {1,}).
? Must occur 0 or 1 time (same as {0,1}).
CharacterMatches
\n Linefeed
\r Carriage return
\t Tab
\v Vertical tab
\f Form-feed
\d A digit (same as [0-9])
\D A non-digit (same as [^0-9])
\w A word (alphanumeric) character (same as [a-zA-Z_0-9])
\W A non-word character (same as [^a-zA-Z_0-9])
\s A whitespace character (same as [ \t\v\n\r\f])
\S A non-whitespace character (same as [^ \t\v\n\r\f])