Route that should be matching numbers not matching a zero? I have the following in my routes.php file:

return array(
    'articles/(?P&lt;sectionId&gt;\d+)/(?P&lt;offset&gt;\d+)' =&gt; 'articles/index'
);


And while localhost/articles/4/1, for example, routes properly to the template, localhost/articles/4/0 does not and I instead get a 404.

Is there an issue with zeros being picked up as valid URI segments?
An easy fix could be to define an additional route without the offset parameter:

return array(
    'articles/(?P&lt;sectionId&gt;\d+)' =&gt; 'articles/index',
    'articles/(?P&lt;sectionId&gt;\d+)/(?P&lt;offset&gt;\d+)' =&gt; 'articles/index',
);


In your template, you'd need to check if the offset parameter is defined, and if not, set it to 0:

{{ offset | default( 0 ) }}


or

{% set offset = offset is defined ? offset : 0 %}


EDIT:

Another way to solve this is by making the offset segment capturing group optional, as per @carlcs' answer to this question – in my opinion this is a bit more elegant than having two different routes:

return array(
    'articles/(?P&lt;sectionId&gt;\d+)(/(?P&lt;offset&gt;\d+))?' =&gt; 'articles/index',
);


The trick here is wrapping the last segment in parentheses, appending a question mark at the end.