diff --git a/lib/Dancer2/Manual.pod b/lib/Dancer2/Manual.pod index 0cc1408eb..3747202a9 100644 --- a/lib/Dancer2/Manual.pod +++ b/lib/Dancer2/Manual.pod @@ -480,6 +480,14 @@ expressions, providing more flexibility in matching URLs: return "Category: $category_name"; }; +It is also possible to use named captures in regular expressions: + + # Matches URL: /product/12345 + get qr{/product/(?\d+)} => sub { + my $product_id = captures->{'product_id'}; + return "Product ID: $product_id"; + }; + =head3 Combining Examples # Matches URL: /item/42/specifications