substr vs regex

David Cantrell david at cantrell.org.uk
Sat Sep 8 19:37:12 BST 2007


Matt Lawrence wrote:
> David Cantrell wrote:
>> On Mon, Sep 03, 2007 at 11:44:53AM +0200, Abigail wrote:
>>>                                                     The speed of the
>>> substr() solution is independent of the length of $variable
>> Only true for constant-width character sets.  This is why UTF-8 is a
>> stupid stupid design.
> I guess you could convert to UTF-32 for substr work.

That's only a win if you're going to do lots of substr()s on one piece
of data.

-- 
David Cantrell | http://www.cantrell.org.uk/david

"The whole aim of practical politics is to keep the populace alarmed
 (and hence clamorous to be led to safety) by menacing it with an
 endless series of hobgoblins, all of them imaginary"  -- H. L. Mencken


More information about the london.pm mailing list