diff -ur ./t/simple.t ./t/simple.t --- ./t/simple.t 2008-11-20 21:26:12.000000000 +0000 +++ ./t/simple.t 2011-12-22 16:47:53.520725394 +0000 @@ -9,11 +9,16 @@ my $format = '%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"'; my @fields = qw/%h %l %u %t %r %>s %b %{Referer}i %{User-Agent}i/; -my $regex = '(?-xism:^(\\S*) (\\S*) (\\S*) (\\[[^\\]]+\\]) (?-xism:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)") (\\S*) (\\S*) (?-xism:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)") (?-xism:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)")\s*$)'; my $line1 = '212.74.15.68 - - [23/Jan/2004:11:36:20 +0000] "GET /images/previous.png HTTP/1.1" 200 2607 "http://peterhi.dyndns.org/bandwidth/index.html" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021202"'; my $line2 = '212.74.15.68 - - [23/Jan/2004:11:36:20 +0000] "GET /images/previous.png=\" HTTP/1.1" 200 2607 "http://peterhi.dyndns.org/bandwidth/index.html" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021202"'; my $line3 = '4.224.234.46 - - [20/Jul/2004:13:18:55 -0700] "GET /core/listing/pl_boat_detail.jsp?&units=Feet&checked_boats=1176818&slim=broker&&hosturl=giffordmarine&&ywo=giffordmarine& HTTP/1.1" 200 2888 "http://search.yahoo.com/bin/search?p=\"grady%20white%20306%20bimini\"" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; YPC 3.0.3; yplus 4.0.00d)"'; +my $regex; +{ + my @inner_regexs = (qr/"([^"\\]*(?:\\.[^"\\]*)*)"/, qr/"([^"\\]*(?:\\.[^"\\]*)*)"/, qr/"([^"\\]*(?:\\.[^"\\]*)*)"/); + $regex = qr/^(\S*) (\S*) (\S*) (\[[^\]]+\]) $inner_regexs[0] (\S*) (\S*) $inner_regexs[1] $inner_regexs[2]\s*$/; +} + ################################################################################ # Create a new object ################################################################################