Re: RegEx speed (was: Using regexp to get a substring)

2002-01-07 Thread Jos I. Boumans
s" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "David" <[EMAIL PROTECTED]> Sent: Sunday, January 06, 2002 11:48 PM Subject: RegEx speed (was: Using regexp to get a substring) > That'll work, but on a finer point, if you need to be thinking about > optimi

RegEx speed (was: Using regexp to get a substring)

2002-01-06 Thread Gary Hawkins
That'll work, but on a finer point, if you need to be thinking about optimization at the moment: ($substring1 = $string) =~ s/.*\\(.*)/$1/; is about 4 times slower than: ($substring2 = $string) =~ s/.*\\//; because the second one doesn't have to store the matched value inside the paren