I'm trying to write a regex route in zend (1.11) that matches urls ending in /foo but not if they start with /bar e.g.
/foo - match
/any/words/foo - match
/any/words - no match (doesn't end in /foo)
/any/words/barfoo - no match (doesn't end in /foo)
/bar/foo - no match (starts with /bar)
/bar/any/words/foo - no match (starts with /bar)
my regext route looks like this:
'^foo$|^(?!/bar/).+/foo$'
But I find it matches anything ending in /foo, even if it starts with /bar.