X-Git-Url: http://erislabs.net/gitweb/?p=liburi-template-perl.git;a=blobdiff_plain;f=lib%2FURI%2FTemplate.pm;h=b3c123180a9cafc7726d7ede2fa797cf9d93ec0e;hp=c7f45a2e5dca58fe731c5755f47cd630cdced550;hb=917525490f5d8e583f4b53dcd2d792b9e6f42c88;hpb=6ce2a97438a9ca90e550caeefb1d3cecf259ded4 diff --git a/lib/URI/Template.pm b/lib/URI/Template.pm index c7f45a2..b3c1231 100644 --- a/lib/URI/Template.pm +++ b/lib/URI/Template.pm @@ -3,7 +3,7 @@ package URI::Template; use strict; use warnings; -our $VERSION = '0.12'; +our $VERSION = '0.13'; use URI; use URI::Escape (); @@ -172,9 +172,7 @@ sub deparse { my $templ = $self->as_string; $self->{ vars_list } = [ $templ =~ /{(.+?)}/g ]; $templ =~ s/{.+?}/(.+?)/g; - # If the template ends w/ a match, then make it greedy. - $templ =~ s/\Q(.+?)\E$/(.+)/; - $self->{ deparse_re } = qr/$templ/; + $self->{ deparse_re } = qr/^${templ}$/; } my @matches = $uri =~ $self->{ deparse_re };