in reply to matching substring in url
#!/usr/bin/perl use warnings; use strict; use URI; use Test::More tests => 2; my %expect = ( '/blah1/blah2/blah3/1234567890;arg=AAA123BBB456CCC' => '1234567890 +', '/blah1/blah2/blah3/1234567890' => '1234567890'); for my $string (keys %expect) { my $uri = ('URI'->new($string)->path_segments)[-1]; is $uri, $expect{$string}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: matching substring in url
by cioperl (Novice) on Nov 08, 2019 at 19:37 UTC |