Matt Simonsen wrote:
> 
> I'm wondering what people would suggest as the best way to split this so
> it respects the "" and [] as fields yet doesn't kill performance?
> 
> 1.2.3.4 - - [15/Aug/2002:06:43:39 -0700] "GET /usr/123 HTTP/1.0" 200
> 38586 "http://www.careercast.com/js.php"; "Mozilla/4.0 (compatible; MSIE
> 5.5; Windows 98)" - www.careercast.com
> 
> In other words I want
> 
> hash[0] = 1.2.3.4
> hash[1] = -
> hash[2] = -
> hash[3] = 15/Aug/2002:06:43:39 -0700
> hash[4] = 200
> hash[...]
> hash[10] = www.careercast.com


my @array = /(\S+)         \s+
             (\S+)         \s+
             (\S+)         \s+
             \[([^\]]+)\]  \s+
             "([^"]+)"     \s+
             (\S+)         \s+
             (\S+)         \s+
             "([^"]+)"     \s+
             "([^"]+)"     \s+
             (\S+)         \s+
             (\S+)
            /x;



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to