the "word" path part regex only allows singular period characters
John Napiorkowski [Wed, 25 Jan 2012 16:18:42 +0000 (17:18 +0100)]
lib/Web/Dispatch/Parser.pm

index bd62652..e3ea504 100644 (file)
@@ -165,7 +165,17 @@ sub _url_path_segment_match {
     /\G(?:(?=[+|\)])|$)/gc and
       return '';
     # word chars only -> exact path part match
-    /\G([\w\-.]+)/gc and
+    /
+        \G(
+            (?:             # start matching at a space followed by:
+                    [\w\-]  # word chars or dashes
+                |           # OR
+                    \.      # a period
+                    (?!\.)  # not followed by another period
+            )
+            +               # then grab as far as possible
+        )
+    /gcx and
       return "\Q$1";
     # ** -> capture unlimited path parts
     /\G\*\*/gc and