Re: Simple regexp

From: Date: Fri, 30 Aug 2002 11:14:47 +0000
Subject: Re: Simple regexp
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-114638@lists.php.net to get a copy of this message
You can use the following pattern with preg_match: "/([a-f0-9]+)((:[a-f0-9]+){7})/i" I made an assumption that you are using the x:x:x:x:x:x:x:x address format. Anil On Wed, 28 Aug 2002, Adam Alkins wrote: > Hi Folks, > > Seeking some guidance here. My regexp knowledge is pathetic. I want to do a simple validation > of an ipv6 address. I just want to validate the entire string (not specific blocks) if it has the > allowed charachters. > > I though ereg('[A-Fa-f0-9:]') would work, but it isn't. Anyone can help me with > this? IPv6 addresses are just Hex with : characters, so I just need to validate that for the entire > string. > > Thanks for your time. > -------------- > Adam Alkins > http://www.rasadam.com > -------------- > -- +91 471 324341 (Office) +91 98473 22280 (Cell) Linuxense Information Systems Pvt. Ltd., Trivandrum, India http://www.linuxense.com

« previous php.general (#114638) next »