Re: Regex question

From: Date: Tue, 31 Jul 2001 12:18:10 +0000
Subject: Re: Regex question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-60390@lists.php.net to get a copy of this message
In article <04E668ABB2C9924A826EFF5B2E7E0D1A6392E4@ntx1.forest.netvision.net.il>, berber@netvision.net.il (Boaz Yahav) wrote: > In case anyone is interested, eregi("HTTP/1.[01].302",$output) seems to > work :) "." == "any character" (including, but not necessarily, a period). If you want to match a period, escape it or put it in square braces: eregi("HTTP/1\.[01].302",$output) -or- eregi("HTTP/1[.][01].302",$output) You might also want to limit what's acceptable before the status code by changing ".302" to: " 302" //space -or- "[ ]302" //space, made more obvious -or- "[[:space:]]302" //any whitespace character -- CC

« previous php.general (#60390) next »