X-Git-Url: http://erislabs.net/gitweb/?p=liburi-template-perl.git;a=blobdiff_plain;f=lib%2FURI%2FTemplate.pm;h=c7f45a2e5dca58fe731c5755f47cd630cdced550;hp=8b676639ca1eed6cfe0e0bac68068eac559506d6;hb=6ce2a97438a9ca90e550caeefb1d3cecf259ded4;hpb=4e234fc969ae1ec9d66e909a05fa0387bfafb331;ds=sidebyside diff --git a/lib/URI/Template.pm b/lib/URI/Template.pm index 8b67663..c7f45a2 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.11'; +our $VERSION = '0.12'; use URI; use URI::Escape (); @@ -172,6 +172,8 @@ 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/; } @@ -188,7 +190,7 @@ Brian Cassidy Ebricas@cpan.orgE =head1 COPYRIGHT AND LICENSE -Copyright 2007 by Brian Cassidy +Copyright 2008 by Brian Cassidy This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.