Re: Seemingly weird regex problem
| From: | Richard Lynch | Date: | Thu, 20 Jan 2005 17:59:10 +0000 |
| Subject: | Re: Seemingly weird regex problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-206853@lists.php.net to get a copy of this message | ||
Tim Boring wrote:
> Hello! I'm having an odd regex problem. Here's a summary of what I'm
> trying to accomplish:
> switch ($line)
> {
> case ($total_counter <= 5):
> break;
> case preg_match("/^\W+/", $line):
While it would be Really Nifty (tm) if PHP worked this way, as far as I
know, you can only have a CONSTANT in your case.
switch($char){
case 'X': echo "It was an X"; break;
}
You can't just put arbitrary expressions there...
Feel free to correct me if the Manual sez different.
--
Like Music?
http://l-i-e.com/artists.htm