The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 09-04-2001
Optimus_P Optimus_P is offline
flim flam flamma jamma
 

Join Date: May 2001
Location: Chicago IL, USA
Posts: 1,006
stright from Mastering Regular Expresstions by Oreilly page 124

Code:
^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.
([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.$
this should all be on 1 line btw. the reason 0-9 wont work as mentioned above it cuz if you want a ligit ip all the time 0-9 wont work. remember 0-9 says even an ip of 999.999.999.999 is valid when we all know is not valid in any universe (yet anyways).

btw this book is a book i think everyone that is into unix, programing, scripting should read.

the hostname check is on page 167

Last edited by Optimus_P; 09-04-2001 at 02:38 PM.