Re: [PHP] Regex in PHP
- Date: Wed, 4 Jun 2008 10:18:14 -0600
- From: "Nathan Nobbe" <quickshiftin@xxxxxxxxx>
- Subject: Re: [PHP] Regex in PHP
On Wed, Jun 4, 2008 at 10:10 AM, Richard Heyes <richardh@xxxxxxxxxxx> wrote:
> Hi,
>
> and the case insensitive versions are a hair faster still ;)
>>
>
> Are they? I always thought that case-sensitive functions were faster
> because they have to test fewer comparisons. Eg To test if i == I in a
> case-insensitive fashion requires two comparisons (i == I and i == i)
> whereas a case-sensitive comparison requires only one (i == i).
umm, isnt it like the other way around. in the case of case-sensitive, you
have to be able to distinguish between i and I, whereas w/ the case
insensitive, you dont care so, basically, you strtolower() first thing, then
just compare to lower case characters.
-nathan