Re: Seemingly weird regex problem
| From: | Jason Wong | Date: | Thu, 20 Jan 2005 18:41:21 +0000 |
| Subject: | Re: Seemingly weird regex problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-206864@lists.php.net to get a copy of this message | ||
On Friday 21 January 2005 01:52, Tim Boring wrote:
> To try to help spot the issue, I put in the if(preg_match("/^\W+/",
> $line)) logic, and the weird thing is that this logic isn't outputting
> the line beginning with things like "AKRN", yet the same line is getting
> caught in the switch statement and being discarded.
Well the biggest problem in your code right now is your incomprehensible (to
me anyway) use of the switch construct. For a start I've no idea why you're
using ...
> switch ($line)
... when your tests do not involve $line
> case ($total_counter <= 5):
I suspect what you want to be doing is something like this:
switch (TRUE) {
case ANY_EXPRESSION_THAT_EVALUATES_TO_TRUE:
...
}
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
New Year Resolution: Ignore top posted posts