«

»

Jul 09 2007

Print this Post

Validar endereço ip no shell

Abaixo segue uma expressão regular retirada do site do Aurélio

  cat ip |
  egrep '^(([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5]).)
  {3}([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$'

A expressão é um pouco grande, porém simples. Veja que as regras se repetem…

Permanent link to this article: http://www.brunorusso.eti.br/brusso-2/validar-endereco-ip-no-shell

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>