I have a URL, and I\'m trying to match it to a regular expression to pull out some groups. The problem I\'m having is that the URL can either end or continue with a
In Ruby and Bash, you can use $ inside parentheses.
$
/(\S+?)/(\d{4}-\d{2}-\d{2})-(\d+)(/|$)
(This solution is similar to Pete Boughton's, but preserves the usage of $, which means end of line, rather than using \z, which means end of string.)
\z