in reply to Re^2: Regex to take an ip address before a comma
in thread Regex to take an ip address before a comma

and here's my result with a perl 5.10 (cygwin on same WinXP)

Rate s/// split_lim split_unl split +_lim_sca s/// 288797/s -- -12% -12% + -15% split_lim 326805/s 13% -- -1% + -4% split_unl 330050/s 14% 1% -- + -3% split_lim_sca 339541/s 18% 4% 3% + --

Replies are listed 'Best First'.
Re^4: Regex to take an ip address before a comma
by ikegami (Patriarch) on Nov 25, 2008 at 17:57 UTC
    How can split which uses a regexp be faster than just a regexp? weird
      why not? It's a different regex after all. .*?, has to check all items prior to the comma because \n isn't allowed there, whereas as simple search for , doesn't have to do this work.
        Nope, that's not it
        # using regex 'm//' => sub { my ( $first ) = $str =~ m/(.*?),/; }, 'm//s' => sub { my ( $first ) = $str =~ m/(.*?),/s; },
        Rate m// m//s split_unl split_lim spl +it_lim_sca m// 486790/s -- -3% -17% -17% + -17% m//s 499664/s 3% -- -15% -15% + -15% split_unl 585631/s 20% 17% -- -0% + -0% split_lim 587555/s 21% 18% 0% -- + -0% split_lim_sca 587951/s 21% 18% 0% 0% + --